18 Commits

Author SHA1 Message Date
Buu Nguyen
75861fac87 Fix bug replacement nodes not requeued (#5743) 2017-08-28 15:10:00 -06:00
Mateusz Burzyński
3c4f19a28d Adjusted Object Rest/Spread tests to use only allowed syntax from the latest spec (#6102) 2017-08-24 15:50:43 -04:00
Noah Lemen
2db0c3ad1d linting: disallow t.identifier("undefined") in plugins (#6096)
* add new custom eslint rule, replace remaining t.identifier("undefined") with buildUndefinedNode(), update tests

* change no-undefined-identifier reporting descriptor
2017-08-24 15:43:01 -04:00
Logan Smyth
95882d4e5a
Rewrite param processing to be more clearly defined. 2017-08-03 20:56:08 -05:00
Henry Zhu
0f823beeb1 Newlines in fixtures (#6044)
* write newlines for fixtures

* rerun fixtures
2017-08-02 15:35:29 -04:00
Daniel Tschinder
b3372a572d Remove whitespace generation (#5833)
* Remove whitespace generation and rely on default printing

Changes to printing:
* Add newline after last empty SwitchCase
* Add newlines around block comments if they are non-flow comments or contain newlines

* Fix a few more fixtures
2017-06-27 21:57:02 -05:00
Buu Nguyen
f58f4ac351 Fix incorrect destructuring in for loop let initialization (#5763)
* Fix incorrect destructuring in for loop `let` initialization

* Improve approach and fix tests
2017-05-31 15:29:50 -04:00
Brian Ng
9d95b3faae
518-spread-assignable 2017-05-23 09:09:01 -05:00
Buu Nguyen
c474fd48e1 Fix issue semi-colon gets inserted unnecessarily (#5749)
* Fix issue semi-colon gets inserted unnecessarily

* Simplify if condition a bit
2017-05-19 16:54:51 -04:00
Sergey Rubanov
292c3ca206 Refactor test packages to use ES modules instead of CJS (#5138) 2017-01-16 11:25:04 -05:00
Brian Ng
46d9339488
arrow 2017-01-11 17:12:09 -06:00
Brian Ng
a749907bc2
Ensure array is always copied during destructure 2017-01-11 09:23:21 -06:00
Moti Zilberman
9fc51d6292 Consolidate contiguous var declarations in destructuring transform (#4690)
* Consolidate contiguous var declarations in destructuring transform

Fixes #3081.

* Simplify var node coalescing in es2015-destructuring

* Revert "Simplify var node coalescing in es2015-destructuring"

This reverts commit 15cb373f0726f68225f7080a7ae206a63af174ee.

* More careful condition for var coalescing in es2015-destructuring
2016-10-14 11:51:22 -04:00
Justin Ridgewell
c2ed9de7fb Flip default parameter template (#4515)
* Flip default parameter template

YMMV, I saved ~10b on a 2kb library. Not noticeable at the small scale, by why not do it anyway?

I've (unscientifically) found that flipping the default parameter conditional yields better gzip results. I think this is due to the slightly longer string it can now repeatedly match:

```js
// old
var param = arguments.length <= 0 || void 0 === arguments[0] ? null : arguments[0]
--------------------------------------------------------------^

// new
var param = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null
------------------------------------------------------------------------^
```

Though it's entirely likely gzip will also choose up to the index of the arguments if you many default parameters at different indexes.

* Update tests
2016-09-25 14:05:53 -07:00
Daniel Tschinder
c2d2702cf9 Fix destructuring evaluation with call expressions (#4552)
* Fix destructuring evaluation with call expressions

Do not optimize destructions with callExpressions, as the call
might change the value of a variable that we are assigning to.

Fixes #4054

* Also deopt on member expressions

members expressions might be getters who have side effects
2016-09-24 19:08:53 -04:00
Sebastian McKenzie
1fa24b1efd rename babel-plugin-external-helpers-2 to babel-plugin-external-helpers 2015-12-24 03:54:40 +00:00
Logan Smyth
29a3176276 Move destructuring statements off export statements before processing - fixes T6720 2015-12-05 14:27:42 -08:00
Sebastian McKenzie
15969a0904 move all plugin tests out of babel-core and into their appropriate folders 2015-11-08 23:04:10 -08:00