-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/minifier): Always consider
reassigned
when inlining (#8168)
**Related issue:** - Closes #8161.
- Loading branch information
Showing
3 changed files
with
15 additions
and
1 deletion.
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
10 changes: 10 additions & 0 deletions
10
crates/swc_ecma_minifier/tests/fixture/issues/8161/input.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function run(flag, output = "a output") { | ||
if (flag === "b") { | ||
output = "b output"; | ||
} | ||
|
||
console.log(output); | ||
} | ||
|
||
run("a"); | ||
run("b"); |
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,4 @@ | ||
function run(flag, output = "a output") { | ||
"b" === flag && (output = "b output"), console.log(output); | ||
} | ||
run("a"), run("b"); |
c26a225
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
297591
ns/iter (± 15876
)299007
ns/iter (± 11909
)1.00
es/full/minify/libraries/antd
1418868535
ns/iter (± 19210989
)1476291998
ns/iter (± 18195232
)0.96
es/full/minify/libraries/d3
293681257
ns/iter (± 947857
)302255474
ns/iter (± 2958233
)0.97
es/full/minify/libraries/echarts
1125468958
ns/iter (± 9821259
)1198367515
ns/iter (± 24792959
)0.94
es/full/minify/libraries/jquery
89100441
ns/iter (± 364942
)89791683
ns/iter (± 336959
)0.99
es/full/minify/libraries/lodash
105560679
ns/iter (± 366341
)104427358
ns/iter (± 596845
)1.01
es/full/minify/libraries/moment
52471867
ns/iter (± 79387
)52793536
ns/iter (± 143385
)0.99
es/full/minify/libraries/react
18905262
ns/iter (± 187544
)18784272
ns/iter (± 166599
)1.01
es/full/minify/libraries/terser
233453084
ns/iter (± 2025616
)232571476
ns/iter (± 1922052
)1.00
es/full/minify/libraries/three
414839760
ns/iter (± 2630087
)417149877
ns/iter (± 2779734
)0.99
es/full/minify/libraries/typescript
2813695612
ns/iter (± 10647686
)2863722850
ns/iter (± 28173893
)0.98
es/full/minify/libraries/victory
609167287
ns/iter (± 11730707
)608216738
ns/iter (± 8250063
)1.00
es/full/minify/libraries/vue
127190271
ns/iter (± 496240
)127630697
ns/iter (± 471004
)1.00
es/full/codegen/es3
33369
ns/iter (± 75
)33784
ns/iter (± 96
)0.99
es/full/codegen/es5
33389
ns/iter (± 281
)33980
ns/iter (± 103
)0.98
es/full/codegen/es2015
33319
ns/iter (± 90
)34079
ns/iter (± 64
)0.98
es/full/codegen/es2016
33329
ns/iter (± 102
)34052
ns/iter (± 65
)0.98
es/full/codegen/es2017
33341
ns/iter (± 113
)33976
ns/iter (± 130
)0.98
es/full/codegen/es2018
33447
ns/iter (± 128
)33869
ns/iter (± 109
)0.99
es/full/codegen/es2019
33332
ns/iter (± 53
)33849
ns/iter (± 124
)0.98
es/full/codegen/es2020
33385
ns/iter (± 89
)33801
ns/iter (± 68
)0.99
es/full/all/es3
176851152
ns/iter (± 1655263
)176853652
ns/iter (± 792771
)1.00
es/full/all/es5
170574306
ns/iter (± 1166089
)170318170
ns/iter (± 4841250
)1.00
es/full/all/es2015
129207422
ns/iter (± 1533857
)128311988
ns/iter (± 654979
)1.01
es/full/all/es2016
128333484
ns/iter (± 923435
)127836789
ns/iter (± 885086
)1.00
es/full/all/es2017
127794822
ns/iter (± 1129992
)127412193
ns/iter (± 1287239
)1.00
es/full/all/es2018
125382985
ns/iter (± 698973
)125094082
ns/iter (± 1029271
)1.00
es/full/all/es2019
125013938
ns/iter (± 1202019
)124469811
ns/iter (± 562487
)1.00
es/full/all/es2020
121063117
ns/iter (± 1272673
)120877524
ns/iter (± 1838480
)1.00
es/full/parser
562074
ns/iter (± 3452
)560613
ns/iter (± 1262
)1.00
es/full/base/fixer
17785
ns/iter (± 49
)17970
ns/iter (± 153
)0.99
es/full/base/resolver_and_hygiene
82619
ns/iter (± 623
)82474
ns/iter (± 335
)1.00
This comment was automatically generated by workflow using github-action-benchmark.