Skip to content

Commit 78f1b3a

Browse files
committed
feat(transformer): enable using by default (#10286)
closes #9744
1 parent 9c1628d commit 78f1b3a

File tree

5 files changed

+386
-191
lines changed

5 files changed

+386
-191
lines changed

crates/oxc_transformer/src/options/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl TransformOptions {
8989
..JsxOptions::default()
9090
},
9191
env: EnvOptions::enable_all(/* include_unfinished_plugins */ false),
92-
proposals: ProposalOptions::default(),
92+
proposals: ProposalOptions { explicit_resource_management: true },
9393
helper_loader: HelperLoaderOptions {
9494
mode: HelperLoaderMode::Runtime,
9595
..Default::default()

napi/transform/src/transformer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ impl TryFrom<TransformOptions> for oxc::transformer::TransformOptions {
174174
None => oxc::transformer::JsxOptions::enable(),
175175
},
176176
env,
177-
proposals: ProposalOptions { explicit_resource_management: false },
177+
proposals: ProposalOptions { explicit_resource_management: true },
178178
helper_loader: options
179179
.helpers
180180
.map_or_else(HelperLoaderOptions::default, HelperLoaderOptions::from),

tasks/coverage/snapshots/semantic_test262.snap

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ commit: bc5c1417
22

33
semantic_test262 Summary:
44
AST Parsed : 44293/44293 (100.00%)
5-
Positive Passed: 42483/44293 (95.91%)
5+
Positive Passed: 42481/44293 (95.91%)
66
tasks/coverage/test262/test/annexB/language/function-code/if-decl-else-decl-a-func-block-scoping.js
77
semantic error: Symbol scope ID mismatch for "f":
88
after transform: SymbolId(3): ScopeId(4294967294)
@@ -8401,6 +8401,53 @@ semantic error: Scope flags mismatch:
84018401
after transform: ScopeId(4): ScopeFlags(Function)
84028402
rebuilt : ScopeId(2): ScopeFlags(Function | DirectEval)
84038403

8404+
tasks/coverage/test262/test/language/statements/await-using/throws-if-initializer-not-object.js
8405+
semantic error: Bindings mismatch:
8406+
after transform: ScopeId(2): ["_usingCtx", "x"]
8407+
rebuilt : ScopeId(2): ["_usingCtx"]
8408+
Bindings mismatch:
8409+
after transform: ScopeId(7): []
8410+
rebuilt : ScopeId(3): ["x"]
8411+
Bindings mismatch:
8412+
after transform: ScopeId(3): ["_usingCtx3", "x"]
8413+
rebuilt : ScopeId(7): ["_usingCtx3"]
8414+
Bindings mismatch:
8415+
after transform: ScopeId(11): []
8416+
rebuilt : ScopeId(8): ["x"]
8417+
Bindings mismatch:
8418+
after transform: ScopeId(4): ["_usingCtx4", "x"]
8419+
rebuilt : ScopeId(12): ["_usingCtx4"]
8420+
Bindings mismatch:
8421+
after transform: ScopeId(15): []
8422+
rebuilt : ScopeId(13): ["x"]
8423+
Bindings mismatch:
8424+
after transform: ScopeId(5): ["_usingCtx5", "x"]
8425+
rebuilt : ScopeId(17): ["_usingCtx5"]
8426+
Bindings mismatch:
8427+
after transform: ScopeId(19): []
8428+
rebuilt : ScopeId(18): ["x"]
8429+
Bindings mismatch:
8430+
after transform: ScopeId(6): ["_usingCtx6", "x"]
8431+
rebuilt : ScopeId(22): ["_usingCtx6"]
8432+
Bindings mismatch:
8433+
after transform: ScopeId(23): []
8434+
rebuilt : ScopeId(23): ["x"]
8435+
Symbol scope ID mismatch for "x":
8436+
after transform: SymbolId(0): ScopeId(2)
8437+
rebuilt : SymbolId(3): ScopeId(3)
8438+
Symbol scope ID mismatch for "x":
8439+
after transform: SymbolId(1): ScopeId(3)
8440+
rebuilt : SymbolId(6): ScopeId(8)
8441+
Symbol scope ID mismatch for "x":
8442+
after transform: SymbolId(2): ScopeId(4)
8443+
rebuilt : SymbolId(9): ScopeId(13)
8444+
Symbol scope ID mismatch for "x":
8445+
after transform: SymbolId(3): ScopeId(5)
8446+
rebuilt : SymbolId(12): ScopeId(18)
8447+
Symbol scope ID mismatch for "x":
8448+
after transform: SymbolId(5): ScopeId(6)
8449+
rebuilt : SymbolId(16): ScopeId(23)
8450+
84048451
tasks/coverage/test262/test/language/statements/class/cpn-class-decl-fields-computed-property-name-from-arrow-function-expression.js
84058452
semantic error: Scope children mismatch:
84068453
after transform: ScopeId(0): [ScopeId(1), ScopeId(4), ScopeId(5), ScopeId(6), ScopeId(7)]
@@ -15656,3 +15703,50 @@ Bindings mismatch:
1565615703
after transform: ScopeId(2): []
1565715704
rebuilt : ScopeId(2): ["a", "b", "rest"]
1565815705

15706+
tasks/coverage/test262/test/language/statements/using/throws-if-initializer-not-object.js
15707+
semantic error: Bindings mismatch:
15708+
after transform: ScopeId(1): ["_usingCtx", "x"]
15709+
rebuilt : ScopeId(1): ["_usingCtx"]
15710+
Bindings mismatch:
15711+
after transform: ScopeId(6): []
15712+
rebuilt : ScopeId(2): ["x"]
15713+
Bindings mismatch:
15714+
after transform: ScopeId(2): ["_usingCtx3", "x"]
15715+
rebuilt : ScopeId(6): ["_usingCtx3"]
15716+
Bindings mismatch:
15717+
after transform: ScopeId(10): []
15718+
rebuilt : ScopeId(7): ["x"]
15719+
Bindings mismatch:
15720+
after transform: ScopeId(3): ["_usingCtx4", "x"]
15721+
rebuilt : ScopeId(11): ["_usingCtx4"]
15722+
Bindings mismatch:
15723+
after transform: ScopeId(14): []
15724+
rebuilt : ScopeId(12): ["x"]
15725+
Bindings mismatch:
15726+
after transform: ScopeId(4): ["_usingCtx5", "x"]
15727+
rebuilt : ScopeId(16): ["_usingCtx5"]
15728+
Bindings mismatch:
15729+
after transform: ScopeId(18): []
15730+
rebuilt : ScopeId(17): ["x"]
15731+
Bindings mismatch:
15732+
after transform: ScopeId(5): ["_usingCtx6", "x"]
15733+
rebuilt : ScopeId(21): ["_usingCtx6"]
15734+
Bindings mismatch:
15735+
after transform: ScopeId(22): []
15736+
rebuilt : ScopeId(22): ["x"]
15737+
Symbol scope ID mismatch for "x":
15738+
after transform: SymbolId(0): ScopeId(1)
15739+
rebuilt : SymbolId(2): ScopeId(2)
15740+
Symbol scope ID mismatch for "x":
15741+
after transform: SymbolId(1): ScopeId(2)
15742+
rebuilt : SymbolId(5): ScopeId(7)
15743+
Symbol scope ID mismatch for "x":
15744+
after transform: SymbolId(2): ScopeId(3)
15745+
rebuilt : SymbolId(8): ScopeId(12)
15746+
Symbol scope ID mismatch for "x":
15747+
after transform: SymbolId(3): ScopeId(4)
15748+
rebuilt : SymbolId(11): ScopeId(17)
15749+
Symbol scope ID mismatch for "x":
15750+
after transform: SymbolId(5): ScopeId(5)
15751+
rebuilt : SymbolId(15): ScopeId(22)
15752+

0 commit comments

Comments
 (0)