-
-
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/minifier): Fix
undefined
judgement (#9146)
**Description:** by symbol name -> by whether it points to global undefined or not. The updated test results all involve variables with `undefined` ident (although they are indeed uninitialized). **Related issue:** - Closes: #8567
- Loading branch information
Showing
9 changed files
with
80 additions
and
85 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const templatePath = () => { | ||
const undefined = "lol1"; | ||
return undefined; | ||
}; | ||
console.log(templatePath()); |
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 @@ | ||
console.log("lol1"); |
2 changes: 1 addition & 1 deletion
2
crates/swc_ecma_minifier/tests/full/feedback-mapbox/785-e1932cc99ac3bb67/output.js
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
Oops, something went wrong.
1a739b7
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
274048
ns/iter (± 2222
)277530
ns/iter (± 1316
)0.99
es/full/minify/libraries/antd
1695564822
ns/iter (± 43062858
)2068690340
ns/iter (± 66548630
)0.82
es/full/minify/libraries/d3
338251959
ns/iter (± 1372251
)427297670
ns/iter (± 10527793
)0.79
es/full/minify/libraries/echarts
1427217495
ns/iter (± 14874268
)1782403033
ns/iter (± 21631962
)0.80
es/full/minify/libraries/jquery
102396840
ns/iter (± 308663
)110711034
ns/iter (± 1613653
)0.92
es/full/minify/libraries/lodash
112668806
ns/iter (± 355384
)121856807
ns/iter (± 1883026
)0.92
es/full/minify/libraries/moment
59554359
ns/iter (± 151920
)62759261
ns/iter (± 401796
)0.95
es/full/minify/libraries/react
18508415
ns/iter (± 92394
)19039215
ns/iter (± 103697
)0.97
es/full/minify/libraries/terser
280054199
ns/iter (± 4005184
)341682493
ns/iter (± 13840088
)0.82
es/full/minify/libraries/three
500566661
ns/iter (± 7436001
)636074858
ns/iter (± 22958037
)0.79
es/full/minify/libraries/typescript
3287195497
ns/iter (± 43476806
)3535337889
ns/iter (± 33966321
)0.93
es/full/minify/libraries/victory
848389974
ns/iter (± 27201697
)1019700307
ns/iter (± 19897044
)0.83
es/full/minify/libraries/vue
147448330
ns/iter (± 1185001
)160562412
ns/iter (± 1996125
)0.92
es/full/codegen/es3
59348
ns/iter (± 346
)60539
ns/iter (± 164
)0.98
es/full/codegen/es5
59727
ns/iter (± 438
)61459
ns/iter (± 490
)0.97
es/full/codegen/es2015
59537
ns/iter (± 84
)60896
ns/iter (± 420
)0.98
es/full/codegen/es2016
59131
ns/iter (± 190
)61107
ns/iter (± 558
)0.97
es/full/codegen/es2017
59344
ns/iter (± 255
)60855
ns/iter (± 355
)0.98
es/full/codegen/es2018
58975
ns/iter (± 112
)61255
ns/iter (± 454
)0.96
es/full/codegen/es2019
59036
ns/iter (± 110
)61536
ns/iter (± 395
)0.96
es/full/codegen/es2020
59019
ns/iter (± 181
)60531
ns/iter (± 103
)0.98
es/full/all/es3
162000009
ns/iter (± 623583
)165173322
ns/iter (± 587926
)0.98
es/full/all/es5
156348179
ns/iter (± 1108289
)159546007
ns/iter (± 405631
)0.98
es/full/all/es2015
115448792
ns/iter (± 904062
)117744203
ns/iter (± 917189
)0.98
es/full/all/es2016
113968466
ns/iter (± 768481
)116652402
ns/iter (± 1328741
)0.98
es/full/all/es2017
113513408
ns/iter (± 617416
)115828027
ns/iter (± 2321375
)0.98
es/full/all/es2018
111808085
ns/iter (± 677179
)113835680
ns/iter (± 878329
)0.98
es/full/all/es2019
111009208
ns/iter (± 575939
)113487523
ns/iter (± 602199
)0.98
es/full/all/es2020
106938012
ns/iter (± 835655
)108667012
ns/iter (± 558434
)0.98
es/full/parser
463013
ns/iter (± 2555
)461526
ns/iter (± 3091
)1.00
es/full/base/fixer
16571
ns/iter (± 53
)15260
ns/iter (± 58
)1.09
es/full/base/resolver_and_hygiene
81205
ns/iter (± 332
)81899
ns/iter (± 332
)0.99
serialization of serde
268
ns/iter (± 8
)271
ns/iter (± 7
)0.99
css/minify/libraries/bootstrap
21852382
ns/iter (± 52767
)22232929
ns/iter (± 491634
)0.98
css/visitor/compare/clone
1370006
ns/iter (± 28720
)1365448
ns/iter (± 9489
)1.00
css/visitor/compare/visit_mut_span
1492342
ns/iter (± 10608
)1479961
ns/iter (± 22575
)1.01
css/visitor/compare/visit_mut_span_panic
1514365
ns/iter (± 38888
)1492992
ns/iter (± 43582
)1.01
css/visitor/compare/fold_span
2012359
ns/iter (± 13215
)1998134
ns/iter (± 18055
)1.01
css/visitor/compare/fold_span_panic
2137985
ns/iter (± 8115
)2119601
ns/iter (± 3059
)1.01
css/lexer/bootstrap_5_1_3
3495403
ns/iter (± 12766
)3510020
ns/iter (± 27575
)1.00
css/lexer/foundation_6_7_4
2820485
ns/iter (± 2042
)2830925
ns/iter (± 2400
)1.00
css/lexer/tailwind_3_1_1
541704
ns/iter (± 453
)548287
ns/iter (± 621
)0.99
css/parser/bootstrap_5_1_3
16390690
ns/iter (± 75830
)16142257
ns/iter (± 124520
)1.02
css/parser/foundation_6_7_4
13066224
ns/iter (± 51006
)12847036
ns/iter (± 7496
)1.02
css/parser/tailwind_3_1_1
2595918
ns/iter (± 6334
)2532937
ns/iter (± 6072
)1.02
es/codegen/colors
751181
ns/iter (± 397426
)723205
ns/iter (± 395543
)1.04
es/codegen/large
3104250
ns/iter (± 1603922
)2954185
ns/iter (± 1592191
)1.05
es/codegen/with-parser/colors
40273
ns/iter (± 275
)40373
ns/iter (± 1056
)1.00
es/codegen/with-parser/large
454966
ns/iter (± 2411
)450111
ns/iter (± 2507
)1.01
es/minify/libraries/antd
1506570317
ns/iter (± 64616813
)1556035566
ns/iter (± 19953000
)0.97
es/minify/libraries/d3
280033637
ns/iter (± 2080207
)311269941
ns/iter (± 14002778
)0.90
es/minify/libraries/echarts
1134426473
ns/iter (± 9853246
)1271524527
ns/iter (± 10723565
)0.89
es/minify/libraries/jquery
82544266
ns/iter (± 561856
)83856042
ns/iter (± 812646
)0.98
es/minify/libraries/lodash
104520766
ns/iter (± 662042
)106062425
ns/iter (± 286615
)0.99
es/minify/libraries/moment
48301710
ns/iter (± 129726
)48967298
ns/iter (± 129629
)0.99
es/minify/libraries/react
16269318
ns/iter (± 15714
)16402658
ns/iter (± 61338
)0.99
es/minify/libraries/terser
216415118
ns/iter (± 1016348
)234130276
ns/iter (± 3193616
)0.92
es/minify/libraries/three
365704664
ns/iter (± 12829052
)415752693
ns/iter (± 9149091
)0.88
es/minify/libraries/typescript
2726964196
ns/iter (± 14042092
)2908174544
ns/iter (± 39554690
)0.94
es/minify/libraries/victory
563844360
ns/iter (± 5505773
)687124561
ns/iter (± 23994129
)0.82
es/minify/libraries/vue
121634496
ns/iter (± 288874
)125026827
ns/iter (± 1194551
)0.97
es/visitor/compare/clone
1726175
ns/iter (± 45558
)1727597
ns/iter (± 21324
)1.00
es/visitor/compare/visit_mut_span
2071947
ns/iter (± 9635
)2156759
ns/iter (± 51195
)0.96
es/visitor/compare/visit_mut_span_panic
2066842
ns/iter (± 28863
)2092305
ns/iter (± 29832
)0.99
es/visitor/compare/fold_span
2790543
ns/iter (± 9084
)2778381
ns/iter (± 7245
)1.00
es/visitor/compare/fold_span_panic
2813270
ns/iter (± 35620
)2852048
ns/iter (± 16530
)0.99
es/lexer/colors
9745
ns/iter (± 22
)9490
ns/iter (± 35
)1.03
es/lexer/angular
5082442
ns/iter (± 4202
)5017920
ns/iter (± 15584
)1.01
es/lexer/backbone
634768
ns/iter (± 2907
)642690
ns/iter (± 9735
)0.99
es/lexer/jquery
3535031
ns/iter (± 3280
)3655353
ns/iter (± 29214
)0.97
es/lexer/jquery mobile
5289261
ns/iter (± 14665
)5620256
ns/iter (± 71086
)0.94
es/lexer/mootools
2804875
ns/iter (± 16049
)2880228
ns/iter (± 34123
)0.97
es/lexer/underscore
518835
ns/iter (± 1489
)540991
ns/iter (± 9134
)0.96
es/lexer/three
16051308
ns/iter (± 48689
)16387885
ns/iter (± 92188
)0.98
es/lexer/yui
2930361
ns/iter (± 25058
)2892301
ns/iter (± 26856
)1.01
es/lexer/cal-com
13273610
ns/iter (± 105495
)13159071
ns/iter (± 612183
)1.01
es/lexer/typescript
91338834
ns/iter (± 1048988
)91636924
ns/iter (± 526946
)1.00
es/parser/colors
23748
ns/iter (± 93
)23413
ns/iter (± 360
)1.01
es/parser/angular
12575286
ns/iter (± 72291
)12501227
ns/iter (± 104762
)1.01
es/parser/backbone
1827980
ns/iter (± 5369
)1820893
ns/iter (± 9018
)1.00
es/parser/jquery
10078458
ns/iter (± 63148
)10080518
ns/iter (± 71709
)1.00
es/parser/jquery mobile
15254876
ns/iter (± 132258
)15157022
ns/iter (± 210538
)1.01
es/parser/mootools
7825589
ns/iter (± 22352
)7812212
ns/iter (± 19503
)1.00
es/parser/underscore
1589804
ns/iter (± 5456
)1593610
ns/iter (± 9578
)1.00
es/parser/three
44457714
ns/iter (± 504088
)44697310
ns/iter (± 867289
)0.99
es/parser/yui
7467198
ns/iter (± 35468
)7398709
ns/iter (± 34944
)1.01
es/parser/cal-com
41156599
ns/iter (± 728390
)39490776
ns/iter (± 429206
)1.04
es/parser/typescript
271669758
ns/iter (± 1451951
)267700269
ns/iter (± 2230846
)1.01
es/preset-env/usage/builtin_type
136446
ns/iter (± 34611
)141391
ns/iter (± 34398
)0.97
es/preset-env/usage/property
16400
ns/iter (± 56
)17394
ns/iter (± 246
)0.94
es/resolver/typescript
99383960
ns/iter (± 1753856
)97988238
ns/iter (± 2700930
)1.01
es/fixer/typescript
80600192
ns/iter (± 3461926
)82433309
ns/iter (± 1841599
)0.98
es/hygiene/typescript
187322364
ns/iter (± 4240872
)172221570
ns/iter (± 2318823
)1.09
es/resolver_with_hygiene/typescript
309636056
ns/iter (± 5850904
)304014032
ns/iter (± 3698153
)1.02
es/visitor/base-perf/module_clone
55740
ns/iter (± 460
)56385
ns/iter (± 392
)0.99
es/visitor/base-perf/fold_empty
59330
ns/iter (± 563
)59508
ns/iter (± 274
)1.00
es/visitor/base-perf/fold_noop_impl_all
59170
ns/iter (± 466
)59542
ns/iter (± 1412
)0.99
es/visitor/base-perf/fold_noop_impl_vec
59670
ns/iter (± 709
)59118
ns/iter (± 324
)1.01
es/visitor/base-perf/boxing_boxed_clone
59
ns/iter (± 0
)62
ns/iter (± 0
)0.95
es/visitor/base-perf/boxing_unboxed_clone
47
ns/iter (± 2
)47
ns/iter (± 0
)1
es/visitor/base-perf/boxing_boxed
106
ns/iter (± 0
)106
ns/iter (± 0
)1
es/visitor/base-perf/boxing_unboxed
79
ns/iter (± 0
)81
ns/iter (± 0
)0.98
es/visitor/base-perf/visit_contains_this
2572
ns/iter (± 12
)2588
ns/iter (± 50
)0.99
es/base/parallel/resolver/typescript
2380133784
ns/iter (± 113477499
)2487456796
ns/iter (± 116512734
)0.96
es/base/parallel/hygiene/typescript
3213274802
ns/iter (± 67879057
)3254392236
ns/iter (± 58144088
)0.99
babelify-only
490130
ns/iter (± 4591
)494774
ns/iter (± 20105
)0.99
parse_and_babelify_angular
40183701
ns/iter (± 491821
)37196429
ns/iter (± 343475
)1.08
parse_and_babelify_backbone
4558441
ns/iter (± 187783
)4340368
ns/iter (± 146357
)1.05
parse_and_babelify_jquery
31788859
ns/iter (± 499855
)29004369
ns/iter (± 410581
)1.10
parse_and_babelify_jquery_mobile
54354191
ns/iter (± 959141
)50614574
ns/iter (± 1083053
)1.07
parse_and_babelify_mootools
29211635
ns/iter (± 548622
)25715385
ns/iter (± 246791
)1.14
parse_and_babelify_underscore
3752039
ns/iter (± 28073
)3662514
ns/iter (± 8100
)1.02
parse_and_babelify_yui
26767573
ns/iter (± 312629
)24313523
ns/iter (± 508815
)1.10
html/minify/document/css_spec
45176997
ns/iter (± 83988
)45347455
ns/iter (± 844079
)1.00
html/minify/document/github
18150050
ns/iter (± 109889
)18175235
ns/iter (± 144195
)1.00
html/minify/document/stackoverflow
16488364
ns/iter (± 348188
)16616657
ns/iter (± 593523
)0.99
html/minify/document_fragment/css_spec
43571678
ns/iter (± 136325
)44088283
ns/iter (± 539654
)0.99
html/minify/document_fragment/github
17731588
ns/iter (± 25099
)17837422
ns/iter (± 439133
)0.99
html/minify/document_fragment/stackoverflow
16155536
ns/iter (± 12278
)16152177
ns/iter (± 50919
)1.00
html/document/visitor/compare/clone
161736
ns/iter (± 977
)168266
ns/iter (± 1503
)0.96
html/document/visitor/compare/visit_mut_span
180865
ns/iter (± 1597
)186163
ns/iter (± 1193
)0.97
html/document/visitor/compare/visit_mut_span_panic
186157
ns/iter (± 7078
)190852
ns/iter (± 1192
)0.98
html/document/visitor/compare/fold_span
231601
ns/iter (± 1969
)235981
ns/iter (± 1505
)0.98
html/document/visitor/compare/fold_span_panic
279870
ns/iter (± 799
)282953
ns/iter (± 1887
)0.99
html/document_fragment/visitor/compare/clone
165609
ns/iter (± 930
)171859
ns/iter (± 1466
)0.96
html/document_fragment/visitor/compare/visit_mut_span
178842
ns/iter (± 1142
)187762
ns/iter (± 1777
)0.95
html/document_fragment/visitor/compare/visit_mut_span_panic
185962
ns/iter (± 1226
)191359
ns/iter (± 1343
)0.97
html/document_fragment/visitor/compare/fold_span
230181
ns/iter (± 978
)234383
ns/iter (± 1955
)0.98
html/document_fragment/visitor/compare/fold_span_panic
278692
ns/iter (± 1578
)283255
ns/iter (± 1512
)0.98
html/lexer/css_2021_spec
12891237
ns/iter (± 12905
)12879102
ns/iter (± 54777
)1.00
html/lexer/github_com_17_05_2022
4954055
ns/iter (± 7199
)4924895
ns/iter (± 7833
)1.01
html/lexer/stackoverflow_com_17_05_2022
4679667
ns/iter (± 25926
)4688996
ns/iter (± 127424
)1.00
html/parser/parser_document/css_2021_spec
25582698
ns/iter (± 184010
)25624559
ns/iter (± 200238
)1.00
html/parser/parser_document/github_com_17_05_2022
8578570
ns/iter (± 73553
)8470308
ns/iter (± 14103
)1.01
html/parser/parser_document/stackoverflow_com_17_05_2022
7397852
ns/iter (± 13320
)7481381
ns/iter (± 14122
)0.99
html/parser/parser_document_fragment/css_2021_spec
25038692
ns/iter (± 186485
)25280391
ns/iter (± 76664
)0.99
html/parser/parser_document_fragment/github_com_17_05_2022
8582789
ns/iter (± 37470
)8430956
ns/iter (± 37717
)1.02
html/parser/parser_document_fragment/stackoverflow_com_17_05_2022
7346312
ns/iter (± 10543
)7429603
ns/iter (± 20206
)0.99
This comment was automatically generated by workflow using github-action-benchmark.