* Add failing test case for object rest after array rest.
Discovered while upgrading https://github.com/meteor/babel to Babel 7.
The error is:
1) babel-plugin-transform-object-rest-spread/object rest with array rest:
TypeError: /Users/ben/dev/babel/packages/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/with-array-rest/actual.js: Property id of VariableDeclarator expected node to be of a type ["LVal"] but instead got null
at Object.validate (packages/babel-types/lib/definitions/index.js:73:13)
at validate (packages/babel-types/lib/index.js:460:9)
at Object.builder (packages/babel-types/lib/index.js:428:7)
at Object.RestElement (packages/babel-plugin-transform-object-rest-spread/lib/index.js:157:41)
at NodePath._call (packages/babel-traverse/lib/path/context.js:53:20)
at NodePath.call (packages/babel-traverse/lib/path/context.js:40:17)
at NodePath.visit (packages/babel-traverse/lib/path/context.js:84:12)
...
* Fix object rest following array rest. (#6213)
* Avoid treating array ...rest elements as object ...rest properties.
* Also avoid treating ...rest parameters as object ...rest properties.
Returning early if the parent was an ArrayPattern was not quite enough,
since a RestElement can appear as a parameter in a Function as well.
* Move RestElement parent check earlier in visitor method.
* avoid duplicating impure initializers in object rest destructuring
* reuse existing VariableDeclarations in object rest destructuring, to fix two issues:
1. inserting an additional VariableDeclaration after the current one may change order of operations, which is unsafe if a future VariableDeclarator refers to a destructured variable.
2. The entire VariableDeclaration is removed when all properties are rest properties, indiscriminately removing other variables
* object rest - fix when destructuring in variables/parameters
* fixes + ExportNamedDeclaration support
* Account for CatchClause
* support ForXStatement
* support assignment expression? + PR fixes
I'm extremely stupid and didn't commit as I go. To anyone reading this
I'm extremely sorry. A lot of these changes are very broad and I plan on
releasing Babel 6.0.0 today live on stage at Ember Camp London so I'm
afraid I couldn't wait. If you're ever in London I'll buy you a beer
(or assorted beverage!) to make up for it, also I'll kiss your feet and
give you a back massage, maybe.