* chore: use yarn 2
* chore: remove redundant yarn locks
* chore: remove publishEslintPkg
* chore: remove redundant make bootstrap
* Update .yarnrc.yml
Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
* chore: use workspace protocol for eslint packages in the root
Co-Authored-By: merceyz <merceyz@users.noreply.github.com>
* chore: pin caniuse-lite versions
Testcases in packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie
depends on specific caniuse-lite versions. We pinned the version here
so we don't have to deal with fixture different in e2e-tests
where all deps will be updated and tested.
* chore: resolve yarn install warnings
* chore: update yarn cache path on circle/travis
* chore: add yarn deduplicate plugin
* chore: deduplicate lock files
* chore: move devDependencies to leaf packages
* chore: remove @yarnpkg/plugin-constraints
* chore: remove unused dedupe options
* test: fix unwanted self reference
* chore: remove output-file-sync dependency
* chore: update browserify to 16.5.2
Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
* Run exec tests in fresh contexts
* Reevaluate modules in every context
* Cache module code when running tests
* Eliminate weakmap accesses as much as possible
* Remove old multiline usage
* Using bundled polyfill to significantly increase performance
The individual requires for each file were the part that was sooooo slow.
* Drop LRU cache size
* Fixes
* Fix test
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
This fixes an issue where destructuring assignments eligible for the "array unpacking" optimization would fail to compile when the array literal on the right-hand side of the expression contained holes.
Example input:
```js
[a, b] = [, 2];
; // Avoid completion record special case
```
The error message was `Property right of AssignmentExpression expected node to be of a type ["Expression"] but instead got null`.
Now the above code compiles to:
```js
a = void 0;
b = 2;
;
```
This PR also adds a couple of related test cases that were missing, to ensure the change doesn't regress them:
* Normal assignment expression with unpacking
* Declaration with unpacking and a hole on RHS
In https://github.com/babel/babel/issues/9511 (and #9495 is another symptom), @PavelKastornyy reported a node crash becaue the JavaScript heap run out of memory. The problem was that their code was adding enumerable properties to `Object.prototype`: it is something that shouldn't be done, but Babel shouldn't make node crash if someone adds them.
I reduced down the problem to `for...in` loops in `@babel/traverse` that grew the memory consumption exponentially because of that unexpected properties.