-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/compat): Fix scoping of
explicit-resource-management
(#8044)
**Related issue:** - Closes #8020
- Loading branch information
Showing
13 changed files
with
64 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript", | ||
"tsx": false | ||
}, | ||
"loose": false, | ||
"minify": { | ||
"compress": false, | ||
"mangle": false | ||
}, | ||
"target": "es2022", | ||
}, | ||
"module": { | ||
"type": "es6" | ||
}, | ||
"minify": false, | ||
"isModule": true, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using foo = null | ||
|
||
const bar = 1 | ||
|
||
console.log(baz()) | ||
|
||
function baz() { | ||
return bar | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { _ as _dispose } from "@swc/helpers/_/_dispose"; | ||
import { _ as _using } from "@swc/helpers/_/_using"; | ||
function baz() { | ||
return bar; | ||
} | ||
try { | ||
var _stack = []; | ||
var foo = _using(_stack, null); | ||
var bar = 1; | ||
console.log(baz()); | ||
} catch (_) { | ||
var _error = _; | ||
var _hasError = true; | ||
} finally{ | ||
_dispose(_stack, _error, _hasError); | ||
} |
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
6 changes: 3 additions & 3 deletions
6
...a_transforms_proposal/tests/explicit-resource-management/transform-await/mixed/output.mjs
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
4 changes: 2 additions & 2 deletions
4
...s_proposal/tests/explicit-resource-management/transform-await/only-using-await/output.mjs
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
2 changes: 1 addition & 1 deletion
2
...ransforms_proposal/tests/explicit-resource-management/transform-sync/bare-block/output.js
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
2 changes: 1 addition & 1 deletion
2
...sforms_proposal/tests/explicit-resource-management/transform-sync/function-body/output.js
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
2 changes: 1 addition & 1 deletion
2
...a_transforms_proposal/tests/explicit-resource-management/transform-sync/if-body/output.js
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
6 changes: 3 additions & 3 deletions
6
...orms_proposal/tests/explicit-resource-management/transform-sync/multiple-nested/output.js
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
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
96a7a4d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
es/full/bugs-1
278077
ns/iter (± 3860
)277979
ns/iter (± 3475
)1.00
es/full/minify/libraries/antd
1308459645
ns/iter (± 19673792
)1305066502
ns/iter (± 9298668
)1.00
es/full/minify/libraries/d3
275911923
ns/iter (± 4551380
)273123510
ns/iter (± 2173234
)1.01
es/full/minify/libraries/echarts
1047573589
ns/iter (± 3575543
)1045670825
ns/iter (± 16019086
)1.00
es/full/minify/libraries/jquery
84056679
ns/iter (± 171108
)83776515
ns/iter (± 188811
)1.00
es/full/minify/libraries/lodash
97710483
ns/iter (± 210410
)97154108
ns/iter (± 201657
)1.01
es/full/minify/libraries/moment
49830144
ns/iter (± 83411
)49561679
ns/iter (± 137623
)1.01
es/full/minify/libraries/react
18017170
ns/iter (± 116945
)17997392
ns/iter (± 175439
)1.00
es/full/minify/libraries/terser
216936122
ns/iter (± 542979
)216144673
ns/iter (± 1478762
)1.00
es/full/minify/libraries/three
386335835
ns/iter (± 3775306
)382282806
ns/iter (± 1169531
)1.01
es/full/minify/libraries/typescript
2639333862
ns/iter (± 15054578
)2638531135
ns/iter (± 4612413
)1.00
es/full/minify/libraries/victory
563374490
ns/iter (± 8212793
)560486005
ns/iter (± 4835168
)1.01
es/full/minify/libraries/vue
119309833
ns/iter (± 506668
)118795476
ns/iter (± 448992
)1.00
es/full/codegen/es3
35604
ns/iter (± 205
)34809
ns/iter (± 129
)1.02
es/full/codegen/es5
35326
ns/iter (± 208
)34666
ns/iter (± 98
)1.02
es/full/codegen/es2015
35281
ns/iter (± 268
)34678
ns/iter (± 146
)1.02
es/full/codegen/es2016
35609
ns/iter (± 119
)34758
ns/iter (± 100
)1.02
es/full/codegen/es2017
35593
ns/iter (± 185
)34751
ns/iter (± 92
)1.02
es/full/codegen/es2018
35682
ns/iter (± 122
)34605
ns/iter (± 138
)1.03
es/full/codegen/es2019
35728
ns/iter (± 100
)34722
ns/iter (± 44
)1.03
es/full/codegen/es2020
35680
ns/iter (± 114
)34601
ns/iter (± 120
)1.03
es/full/all/es3
164928629
ns/iter (± 1259944
)164676996
ns/iter (± 796755
)1.00
es/full/all/es5
158091998
ns/iter (± 1798692
)159579307
ns/iter (± 1502040
)0.99
es/full/all/es2015
117084226
ns/iter (± 348183
)118295076
ns/iter (± 1172604
)0.99
es/full/all/es2016
116054688
ns/iter (± 611124
)116942311
ns/iter (± 576146
)0.99
es/full/all/es2017
116259348
ns/iter (± 533786
)116517874
ns/iter (± 486618
)1.00
es/full/all/es2018
114547230
ns/iter (± 750095
)114481237
ns/iter (± 620100
)1.00
es/full/all/es2019
112874685
ns/iter (± 643492
)113785358
ns/iter (± 859988
)0.99
es/full/all/es2020
108706564
ns/iter (± 759271
)110296302
ns/iter (± 935587
)0.99
es/full/parser
493901
ns/iter (± 4562
)502292
ns/iter (± 5375
)0.98
es/full/base/fixer
18228
ns/iter (± 545
)19037
ns/iter (± 88
)0.96
es/full/base/resolver_and_hygiene
81240
ns/iter (± 143
)81573
ns/iter (± 113
)1.00
serialization of serde
310
ns/iter (± 2
)282
ns/iter (± 9
)1.10
This comment was automatically generated by workflow using github-action-benchmark.