25 Commits

Author SHA1 Message Date
Henry Zhu
cde0054227 Scoped: change src imports to @babel/ [skip ci] 2017-10-16 22:49:56 -04:00
Ben Newman
c4f6a7a06f Add failing test case for object rest after array rest, and fix it. (#6213)
* 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.
2017-09-11 11:16:14 -04:00
Logan Smyth
d86ae2fb84
Remove _blockHoist usage from param processing. 2017-08-03 20:56:50 -05:00
Logan Smyth
18084db7cf
Fix an ordering bug in object-rest-spread. 2017-08-03 20:56:24 -05:00
Peeyush Kushwaha
4a35243118 Non string computed keys in object-rest-spread (#5757) 2017-07-25 09:46:52 -05:00
Brian Ng
e4b35f680d
Run prettier 2017-06-27 12:15:00 -05:00
Brian Ng
79c1eed8c1 Fix incorrect property ordering with obj rest spread on nested (#5685) 2017-05-02 14:04:37 -04:00
Christopher Karper
14ed03127c Fix object destructuring in param arrays (#5650) 2017-04-20 10:45:45 -04:00
Brian Ng
8a82cc060a Run new lint rules (#5413) 2017-03-04 10:46:01 -05:00
Henry Zhu
3ff77a61e4 Update babylon beta 3 (#5394)
* Update babylon to v7-beta.3

* convert RestProperty/SpreadProperty to RestElement/SpreadElement

* add virtual types to make it easier to upgrade
2017-02-28 16:58:19 -05:00
Logan Smyth
4ee385e96c Avoid usage of exports/module.exports/require(). 2017-02-21 16:52:42 -08:00
Logan Smyth
b845f2b69d Re-enable the max-len ESLint rule. (#5265) 2017-02-04 11:07:15 -05:00
Erik Desjardins
bca170ad79 Avoid duplicating impure expressions in object rest destructuring (#5151)
* 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
2017-01-18 21:32:44 -05:00
Christophe Hurpeau
4a1965511f fix: plugin-transform-object-rest-spread param with default value 2017-01-15 14:02:08 -08:00
Henry Zhu
672adba9a1 enable prefer const (#5113) 2017-01-14 09:48:52 -05:00
Henry Zhu
cfc1e5cb38 fix object spread (#4976) 2016-12-08 20:13:57 -05:00
Henry Zhu
88bc28c414 Fix nested object spread (#4974) 2016-12-08 19:30:50 -05:00
Christophe Hurpeau
81575bcdfe Fix for object-rest with parameters destructuring nested rest (#4883) 2016-12-01 23:58:07 -05:00
Henry Zhu
cd041541b8 Fix bug + Generate test fixtures if no expected.js (#4858) 2016-11-17 17:53:46 -05:00
Henry Zhu
5e0508d57c object rest - fix when destructuring in variables/parameters (#4755)
* object rest - fix when destructuring in variables/parameters

* fixes + ExportNamedDeclaration support

* Account for CatchClause

* support ForXStatement

* support assignment expression? + PR fixes
2016-11-15 11:31:03 -05:00
Henry Zhu
d2d34ba8e7 object rest spread useBuiltIns option (#4491)
* feat(transform-object-rest-spread): add polyfill=false option to avoid extends helper

* object-rest-spread: add useBuiltIns option

* add test for invalid option
2016-09-09 18:38:50 -04:00
Amjad Masad
3667527d04 Revert "Remove flow"
This reverts commit 2827ff6b01dcce69e9d3c0402e96b52b3a2a47ee.
2016-03-03 14:49:20 -08:00
Sam Goldman
2827ff6b01 Remove flow 2016-03-01 22:33:30 -08:00
Sebastian McKenzie
ae7d5367f1 6.0.0
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.
2015-10-29 17:51:24 +00:00
Sebastian McKenzie
9969224a93 add more plugins, rename some 2015-09-15 06:12:46 +01:00