Skip to content

Commit

Permalink
fix(transformer/class-properties): fix SymbolFlags for _super fun…
Browse files Browse the repository at this point in the history
…ction (#7709)

Fix `SymbolFlags` for generated `_super` function outside class.
  • Loading branch information
overlookmotel committed Dec 8, 2024
1 parent de5b0b6 commit 97e4185
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ impl<'a, 'c> ConstructorParamsSuperReplacer<'a, 'c> {
self.ctx.generate_uid(
"super",
self.ctx.current_scope_id(),
SymbolFlags::FunctionScopedVariable,
SymbolFlags::BlockScopedVariable,
)
});

Expand Down
19 changes: 2 additions & 17 deletions tasks/transform_conformance/snapshots/babel.snap.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
commit: 54a8389f

Passed: 434/846
Passed: 437/846

# All Passed:
* babel-plugin-transform-class-static-block
Expand Down Expand Up @@ -276,7 +276,7 @@ x Output mismatch
x Output mismatch


# babel-plugin-transform-class-properties (107/264)
# babel-plugin-transform-class-properties (110/264)
* assumption-constantSuper/complex-super-class/input.js
x Output mismatch

Expand Down Expand Up @@ -821,21 +821,6 @@ x Output mismatch
* public/delete-super-property/input.js
x Output mismatch

* public/derived-super-in-default-params/input.js
Symbol flags mismatch for "_super":
after transform: SymbolId(2): SymbolFlags(FunctionScopedVariable)
rebuilt : SymbolId(0): SymbolFlags(BlockScopedVariable)

* public/derived-super-in-default-params-complex/input.js
Symbol flags mismatch for "_super":
after transform: SymbolId(2): SymbolFlags(FunctionScopedVariable)
rebuilt : SymbolId(0): SymbolFlags(BlockScopedVariable)

* public/derived-super-in-default-params-in-arrow/input.js
Symbol flags mismatch for "_super":
after transform: SymbolId(2): SymbolFlags(FunctionScopedVariable)
rebuilt : SymbolId(0): SymbolFlags(BlockScopedVariable)

* public/extracted-this/input.js
x Output mismatch

Expand Down
13 changes: 2 additions & 11 deletions tasks/transform_conformance/snapshots/oxc.snap.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
commit: 54a8389f

Passed: 94/106
Passed: 95/106

# All Passed:
* babel-plugin-transform-class-properties
* babel-plugin-transform-class-static-block
* babel-plugin-transform-nullish-coalescing-operator
* babel-plugin-transform-optional-catch-binding
Expand All @@ -15,16 +16,6 @@ Passed: 94/106
* regexp


# babel-plugin-transform-class-properties (1/2)
* super-in-constructor-strict/input.js
Symbol flags mismatch for "_super":
after transform: SymbolId(6): SymbolFlags(FunctionScopedVariable)
rebuilt : SymbolId(1): SymbolFlags(BlockScopedVariable)
Symbol flags mismatch for "_super2":
after transform: SymbolId(7): SymbolFlags(FunctionScopedVariable)
rebuilt : SymbolId(5): SymbolFlags(BlockScopedVariable)


# babel-plugin-transform-async-to-generator (14/15)
* super/nested/input.js
x Output mismatch
Expand Down

0 comments on commit 97e4185

Please sign in to comment.