-
-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(transformer/class-properties): run other transforms on static pro…
…perties, static blocks, and computed keys (#7982) Large re-architecting of class properties transform. Split transform into 3 phases: 1. Transform instance properties when entering class. 2. Transform private fields during traversal of class body. 3. Transform static properties and static blocks when exiting class. This ensures that code which has to be moved outside of the class (static property initializers, static blocks, computed keys) can get transformed by other transforms before they're moved out. Also fixes a problem where we previously registered private properties too early - on entering the class, rather than the class *body*, so private fields in `extends` clause of a nested class were misinterpretted.
- Loading branch information
1 parent
6b6444b
commit 273795d
Showing
21 changed files
with
996 additions
and
668 deletions.
There are no files selected for viewing
821 changes: 493 additions & 328 deletions
821
crates/oxc_transformer/src/es2022/class_properties/class.rs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.