* fix: support static private field destructure set ([C.#p] = [0])
* 🚧
* fix: add compatibility warning for older @babel/helper versions
* refactor: extract common routines among classPrivateFiled helpers
* More 🚧
* fix: class private accessor without getter
* Provide default return if 'writeOnlyError' is not available
* Add warning for old `@babel/helpers`
* Add missing helper call
* Allow rest/spread on polyfilled or builtin iterables when `Symbol` unsupported
Currently, when `Symbol` is not supported, we allow using rest/spread with:
- arrays
- strings
- arguments
With this PR, it will be also possible to use it with
- maps
- sets
- binary arrays
While in old browsers es6 builtins would still need to be polyfilled, it's way
easier to polyfill them because `Symbol` cannot be reliably polyfilled.
I didn't use `instanceof` becase:
- it doesn't work with polyfills not attatched to the global scope
- when using Babel to load polyfills, it would force the inclusion of `Map` and `Set` polyfills even if they are not used
Downside: the current approach of relying on `toString || construcor.name` doesn't work with subclasses.
* Don't use Array.from for array-like objects
* 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
This PR allows legacy decorators to work with strict class fields, which
are now stage 3 and have shipped in a number of browsers. Allowing this will
allow users of the legacy transform (which is currently recommended by the
champions of the decorator proposal) to use the proper class field semantics
for non-decorated fields, which should help prevent breakage later on.
This change is not a breaking change, since users had to explicitly opt into
loose mode in class fields before. This just gives them the option to remove
that opt-in.
* fix: [#10561] _interopRequireWildcard should cache object only
* fix: narrow down cache restriction to object/function type
* test: add interop require null module case
* Improves the logic to import objects in helpers
* Modified to work with more cases.
* Modified by considering exception cases
* Fixed not using bundler's polyfill
Co-Authored-By: Jordan Harband <ljharb@gmail.com>
* Updated test output files
* Changes to cache logic
* Modified to use if statement
* 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
* destructuring private fields with array pattern / object pattern
* wip: new test cases
* destrucuring and rest for private properties
* test case for loose private-loose
* add transform-desturcturing for exec
* update test case
* remove getPrototypeOf imports from get and set
* wip: destructure super assignment
* throw "Destructuring to a super field is not supported yet."
* fix tests and fix assignment pattern
* remove CallExpression from AssignmentPattern
This reverts commit 43b83f8ed7545b9c049eeed85541fa162842fb8f.
Fix objectSpread helper breaking old codes
remove tests to regenerate later
renamed output
new name
try using word
add comment as requested
revert inline name changes
add 2 for consistency
Update packages/babel-helpers/src/helpers.js
Co-Authored-By: Daniel Tschinder <daniel@tschinder.de>