* Replace lodash 'values' usage with Object.keys => .map(obj[key])
* Block scoping: refactor letReferences, outsideLetReferences as objects of type Map
* Remove lodash dependency from babel-plugin-transform-block-scoping
* Fixup: Add missing Object.keys call
* Fixup: Update remaining property accessors
* Coerce Map.values() iterator results into an array via spread operator
* Fixup: Map.put -> Map.set
* Fixup: undo incorrect variable de-duplication
* Replace array-spread-plus-map combination with Array.from call
* Extract an extendMap function as an attempt to create an optimization boundary
* Experiment: cast objects to string (eliminates one Map/object difference per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map )
* Fixup: perform String cast on map keys, not values
* Revert "Fixup: perform String cast on map keys, not values"
This reverts commit abdd147438fa74f51ac50ef1f96bb462810cd3f2.
* Revert "Experiment: cast objects to string (eliminates one Map/object difference per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map )"
This reverts commit a4035c885b37bfd6e926a0362bda9dcf5b5a52c2.
* Experiment: filter keys via Object.prototype.hasOwnProperty.call
* Revert "Experiment: filter keys via Object.prototype.hasOwnProperty.call"
This reverts commit 491c093f213c6229815b2e6dc9243245376265b0.
* Migrate back from Map-based reference storage to Object-based storage; access performance appears much improved for Object property access
* Revert "Migrate back from Map-based reference storage to Object-based storage; access performance appears much improved for Object property access"
This reverts commit 2119acc7f0d78ced3b9ad77820b4b72e5ad67475.
* Iterate over a clone of outsideRefs keys
* Revert "Extract an extendMap function as an attempt to create an optimization boundary"
This reverts commit 85689f2bfc180d0b5c0e674e5de7954470c7ec69.
* Fixup: migrate remaining Object property access to Map.get in tdz module
* Mark transpiled JSX elements as pure
* Avoid duble annotation
* Add "pure" option to the React preset
* Fix generator indentation
* Update tests
* Add tests for the "pure" option
* Update windows fixtures
* Extract for-of iterator handling to a helper
Dis greatly recudes the code size when for-of is used multiple times across the
codebase. Also, makes it easier to read what's happening in a compiled loop.
* Unify spec and loose code
* Legacy implementation fallback
* Update tmp var name
* Updates from review and after rebase
* fix: should not remove let binding even it is wrapped in closure
Fixes#10339
* fix: remove bindings defined in blockScope when wrapped in closure
* Move test assertions to the top level to ensure that they run
* fix: typo
* declare name for flow interface
* add test case for export overload function, typescript
* test: add test
Fixes#10044
* test: update test
* test(flow): add multiple declarations regression test
* re-enable flow test case
# Conflicts:
# packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/def-site-variance/input.js
# packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-declare-statements/input.js
# packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-interfaces-module-and-script/input.js
# packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-iterator/input.js
* test: disable two flow dupl-decl test
* fix: do not declare name for declare function until we figure out a better way
* test: duplicate declare function and function would not throw
* Better tdz tests
- Use jest's expect.toThrow/expect.not.toThrow
- Add input/output tests
* Fix basic tdz (a = 2; let a)
Fixes#6848
* Make _guessExecutionStatusRelativeTo more robust
* Add tests
* Return less "unkown" execution status
* "function" execution status does not exist
* Fix recursive functions
* Update helper version
* "finally" blocks are always executed
* Typo
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.
* Migrate try-catch duplicate error
* Remove exception for functions and let in the same scope
* Migrate duplicate bindings tests to traverse
* Add test for subscope and let/const
* Add more test cases
* rename colliding let bindings with for loop init
* added complex test case to check if loop init collisions were handled correctly
* updated test files