* fix: fix static private field shadowed by local variable
currently throw an error, maybe we could generate correct code
fix#12960
* feat: rename local variable and add test cases
* feat: add unshadow to privateIn visitor
also add test cases
* test: add reference to shadowed variable
* refactor: apply suggested changes
simplify logic and add comments
* fix(class-properties): replace `new.target` in static properties with `undefined`
non-static prop is not affected
fix#12737
* Update packages/babel-helper-create-class-features-plugin/src/fields.ts
fix typo
Co-authored-by: Brian Ng <bng412@gmail.com>
* fix: add loose test case and fix replace condition
* test: add new.target tests for static block
* feat: move new-target replace into thisContextVisitor
defaults to replace new.target, do not replace within function
* feat: simplify thisContextVisitor
remove function visitor since environmentVisitor is skipping arrow function
* test: remove unused fixme comments
Co-authored-by: Brian Ng <bng412@gmail.com>
* 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: evaluate initializer when a private method is set as a field
* make legacy node happy
* add accessor test cases
* fix: evaluate object before RHS
* fix: evaluate object before throwing writeOnlyError
* fix: class private accessor without getter
* Provide default return if 'writeOnlyError' is not available
* Add warning for old `@babel/helpers`
* Add missing helper call
* rename own binding inside methods if it collides with class ref. fix#11994
* fix name collisions in constructor
* do fix name collisions in constructor
* move logic in ReplaceSupers
* fix tests of helper-create-class-features-plugin
* remove replaceSupers in pushConstructor
* use environmentVisitor
* skip classLike nodes
* fix super ref in computed key
* Fix nested classes reference private fields
* Process only visible private fields when redeclaring
* Comments
* Skip class traversal if there are no private fields
* Handle redeclared private field in computed key
* Ignore abstract methods when decorating class
* Address Nico's feedback
* Add input/output test
* Update test output to account for _nonIterableRest changes
* Draft fix for TDZError in computed prototype methods
* Added tests for loose:false and also extracted handleClassTDZ
* Added state parameter to handleClassTDZ function
* Extracted the state object to a variable
* Added helper comments for environmentVisitor
* Added else condition to traverse computed Path
* Cached computed path key into a variable
* [parser] Add support for TS declare modifier on fields (#10484)
* [parser] Add support for TS declare modifier on fields
* Use Object.create(null)
* Comment
* Add support for TS declare types to types and generator (#10544)
* Transform TypeScript "declare" fields (#10546)
* Transform TypeScript "declare" fields
* Remove multiple spaces
* declareFields -> allowDeclareFields
* Update after rebase
* 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
* test case for insertBefore for jsx
* fix unshiftContainer and insertBefore
* use path.scope.push
* add test making sure computedKeys var declaration at the right block
* add comment
* nit [skip ci]
* Fix super method call in private instance method calling overridden method
* Change return value in test fixtures
* Update tests to verify that overridden method is not called