-
-
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): Skip function scope in
block-scoped-fns
pass (#7975)
**Related issue:** - Closes: #2793
- Loading branch information
1 parent
e146ff7
commit d91a554
Showing
121 changed files
with
2,255 additions
and
2,093 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,5 @@ | ||
{ | ||
"jsc": { | ||
"target": "es5" | ||
} | ||
} |
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,34 @@ | ||
function foo() {} | ||
|
||
function foo() { | ||
function bar() {} | ||
} | ||
|
||
/////////////////// | ||
{ | ||
function foo() {} | ||
} | ||
|
||
{ | ||
{ | ||
function foo() {} | ||
} | ||
} | ||
|
||
if (true) { | ||
function foo() {} | ||
} | ||
|
||
try { | ||
function foo() {} | ||
} catch (e) { | ||
function foo() {} | ||
} finally { | ||
function foo() {} | ||
} | ||
|
||
switch (x) { | ||
default: { | ||
function foo() {} | ||
} | ||
} |
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,27 @@ | ||
function foo() {} | ||
function foo() { | ||
function bar() {} | ||
} | ||
/////////////////// | ||
{ | ||
var foo1 = function foo1() {}; | ||
}{ | ||
{ | ||
var foo2 = function foo2() {}; | ||
} | ||
}if (true) { | ||
var foo3 = function foo3() {}; | ||
} | ||
try { | ||
var foo4 = function foo4() {}; | ||
} catch (e) { | ||
var foo5 = function foo5() {}; | ||
} finally{ | ||
var foo6 = function foo6() {}; | ||
} | ||
switch(x){ | ||
default: | ||
{ | ||
var foo7 = function foo7() {}; | ||
} | ||
} |
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: 5 additions & 5 deletions
10
crates/swc/tests/fixture/issues-6xxx/6345/1/output/index.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
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
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
4 changes: 2 additions & 2 deletions
4
.../swc/tests/tsc-references/FunctionAndModuleWithSameNameAndDifferentCommonRoot.1.normal.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
Oops, something went wrong.
d91a554
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
291271
ns/iter (± 7629
)286527
ns/iter (± 5545
)1.02
es/full/minify/libraries/antd
1290222316
ns/iter (± 6616820
)1341640931
ns/iter (± 19093820
)0.96
es/full/minify/libraries/d3
274470290
ns/iter (± 2732425
)293412364
ns/iter (± 6721225
)0.94
es/full/minify/libraries/echarts
1023013542
ns/iter (± 5681241
)1099869856
ns/iter (± 53101563
)0.93
es/full/minify/libraries/jquery
83738151
ns/iter (± 140019
)84574471
ns/iter (± 577717
)0.99
es/full/minify/libraries/lodash
96401929
ns/iter (± 186788
)97899239
ns/iter (± 1258337
)0.98
es/full/minify/libraries/moment
49550605
ns/iter (± 124381
)49796489
ns/iter (± 236662
)1.00
es/full/minify/libraries/react
17926503
ns/iter (± 40517
)18034686
ns/iter (± 93862
)0.99
es/full/minify/libraries/terser
215057306
ns/iter (± 577178
)219916203
ns/iter (± 2202834
)0.98
es/full/minify/libraries/three
378687630
ns/iter (± 934136
)394051997
ns/iter (± 10217188
)0.96
es/full/minify/libraries/typescript
2607999632
ns/iter (± 7818306
)2650637010
ns/iter (± 46296548
)0.98
es/full/minify/libraries/victory
555094223
ns/iter (± 2978373
)560046547
ns/iter (± 5743602
)0.99
es/full/minify/libraries/vue
118243071
ns/iter (± 226987
)118651680
ns/iter (± 655484
)1.00
es/full/codegen/es3
34915
ns/iter (± 61
)33980
ns/iter (± 75
)1.03
es/full/codegen/es5
34769
ns/iter (± 82
)34051
ns/iter (± 140
)1.02
es/full/codegen/es2015
34812
ns/iter (± 95
)33984
ns/iter (± 69
)1.02
es/full/codegen/es2016
34871
ns/iter (± 52
)33977
ns/iter (± 40
)1.03
es/full/codegen/es2017
34880
ns/iter (± 81
)34021
ns/iter (± 95
)1.03
es/full/codegen/es2018
34834
ns/iter (± 70
)33986
ns/iter (± 40
)1.02
es/full/codegen/es2019
34827
ns/iter (± 83
)33891
ns/iter (± 67
)1.03
es/full/codegen/es2020
34852
ns/iter (± 91
)34001
ns/iter (± 83
)1.03
es/full/all/es3
165909650
ns/iter (± 1306080
)166383207
ns/iter (± 1472751
)1.00
es/full/all/es5
158241506
ns/iter (± 1687849
)158443828
ns/iter (± 737774
)1.00
es/full/all/es2015
117248903
ns/iter (± 581802
)118069357
ns/iter (± 871648
)0.99
es/full/all/es2016
116681920
ns/iter (± 599433
)116543165
ns/iter (± 631312
)1.00
es/full/all/es2017
115713717
ns/iter (± 321588
)116418721
ns/iter (± 845104
)0.99
es/full/all/es2018
114585197
ns/iter (± 581069
)114508582
ns/iter (± 458995
)1.00
es/full/all/es2019
113876823
ns/iter (± 679582
)113596221
ns/iter (± 959347
)1.00
es/full/all/es2020
109497543
ns/iter (± 544870
)109155796
ns/iter (± 589614
)1.00
es/full/parser
496045
ns/iter (± 5370
)489947
ns/iter (± 5387
)1.01
es/full/base/fixer
19747
ns/iter (± 283
)18742
ns/iter (± 114
)1.05
es/full/base/resolver_and_hygiene
80334
ns/iter (± 163
)80005
ns/iter (± 122
)1.00
serialization of serde
292
ns/iter (± 1
)295
ns/iter (± 2
)0.99
css/minify/libraries/bootstrap
28871922
ns/iter (± 34164
)28776211
ns/iter (± 81619
)1.00
css/visitor/compare/clone
1670471
ns/iter (± 9340
)1668480
ns/iter (± 3981
)1.00
css/visitor/compare/visit_mut_span
1804882
ns/iter (± 5576
)1794898
ns/iter (± 6867
)1.01
css/visitor/compare/visit_mut_span_panic
1882789
ns/iter (± 6647
)1856908
ns/iter (± 4355
)1.01
css/visitor/compare/fold_span
2590382
ns/iter (± 9935
)2571687
ns/iter (± 4958
)1.01
css/visitor/compare/fold_span_panic
2757482
ns/iter (± 2402
)2766270
ns/iter (± 5415
)1.00
css/lexer/bootstrap_5_1_3
4516907
ns/iter (± 38420
)4447858
ns/iter (± 62280
)1.02
css/lexer/foundation_6_7_4
3769995
ns/iter (± 4762
)3730032
ns/iter (± 3213
)1.01
css/lexer/tailwind_3_1_1
724048
ns/iter (± 228
)708597
ns/iter (± 1175
)1.02
css/parser/bootstrap_5_1_3
19361853
ns/iter (± 40018
)19669470
ns/iter (± 136352
)0.98
css/parser/foundation_6_7_4
15180174
ns/iter (± 20253
)15505757
ns/iter (± 21530
)0.98
css/parser/tailwind_3_1_1
2934089
ns/iter (± 2697
)2994202
ns/iter (± 12327
)0.98
es/codegen/colors
735741
ns/iter (± 400778
)728304
ns/iter (± 397026
)1.01
es/codegen/large
3156314
ns/iter (± 1680374
)3140497
ns/iter (± 1668389
)1.01
es/codegen/with-parser/colors
45113
ns/iter (± 91
)45945
ns/iter (± 151
)0.98
es/codegen/with-parser/large
485228
ns/iter (± 776
)488320
ns/iter (± 1941
)0.99
es/minify/libraries/antd
1112818160
ns/iter (± 9187671
)1169279324
ns/iter (± 11911837
)0.95
es/minify/libraries/d3
236921883
ns/iter (± 1313709
)239568363
ns/iter (± 724527
)0.99
es/minify/libraries/echarts
878883992
ns/iter (± 3685684
)913752172
ns/iter (± 7013231
)0.96
es/minify/libraries/jquery
72576054
ns/iter (± 95220
)73124786
ns/iter (± 116031
)0.99
es/minify/libraries/lodash
86540669
ns/iter (± 183447
)86888778
ns/iter (± 284513
)1.00
es/minify/libraries/moment
43146257
ns/iter (± 44482
)43506211
ns/iter (± 233667
)0.99
es/minify/libraries/react
15909917
ns/iter (± 50741
)16121215
ns/iter (± 66914
)0.99
es/minify/libraries/terser
184321073
ns/iter (± 346551
)186889237
ns/iter (± 456077
)0.99
es/minify/libraries/three
316015293
ns/iter (± 725364
)324745845
ns/iter (± 1383546
)0.97
es/minify/libraries/typescript
2209558324
ns/iter (± 5742651
)2272065915
ns/iter (± 13673506
)0.97
es/minify/libraries/victory
469708553
ns/iter (± 3749820
)475592222
ns/iter (± 2969781
)0.99
es/minify/libraries/vue
104708175
ns/iter (± 174936
)106491397
ns/iter (± 473568
)0.98
es/visitor/compare/clone
1946030
ns/iter (± 2918
)1963025
ns/iter (± 7720
)0.99
es/visitor/compare/visit_mut_span
2278689
ns/iter (± 4481
)2300835
ns/iter (± 5399
)0.99
es/visitor/compare/visit_mut_span_panic
2324604
ns/iter (± 1720
)2333279
ns/iter (± 5796
)1.00
es/visitor/compare/fold_span
3364353
ns/iter (± 6519
)3379509
ns/iter (± 5730
)1.00
es/visitor/compare/fold_span_panic
3504965
ns/iter (± 9474
)3540958
ns/iter (± 4690
)0.99
es/lexer/colors
13393
ns/iter (± 16
)13175
ns/iter (± 8
)1.02
es/lexer/angular
6156340
ns/iter (± 3869
)6117668
ns/iter (± 23100
)1.01
es/lexer/backbone
800635
ns/iter (± 11161
)789538
ns/iter (± 786
)1.01
es/lexer/jquery
4553174
ns/iter (± 7186
)4507316
ns/iter (± 12594
)1.01
es/lexer/jquery mobile
6945867
ns/iter (± 3811
)6872445
ns/iter (± 5580
)1.01
es/lexer/mootools
3607527
ns/iter (± 3939
)3583795
ns/iter (± 7054
)1.01
es/lexer/underscore
674340
ns/iter (± 1583
)673089
ns/iter (± 1681
)1.00
es/lexer/three
21773567
ns/iter (± 46855
)21577969
ns/iter (± 32159
)1.01
es/lexer/yui
3881098
ns/iter (± 4105
)3851062
ns/iter (± 4856
)1.01
es/parser/colors
26885
ns/iter (± 62
)27706
ns/iter (± 402
)0.97
es/parser/angular
13435870
ns/iter (± 56139
)13679330
ns/iter (± 56353
)0.98
es/parser/backbone
1973488
ns/iter (± 8051
)2010213
ns/iter (± 9704
)0.98
es/parser/jquery
10788276
ns/iter (± 46993
)10946093
ns/iter (± 45235
)0.99
es/parser/jquery mobile
16539323
ns/iter (± 68374
)16701337
ns/iter (± 85625
)0.99
es/parser/mootools
8327372
ns/iter (± 15731
)8441850
ns/iter (± 17658
)0.99
es/parser/underscore
1697510
ns/iter (± 8168
)1731040
ns/iter (± 12258
)0.98
es/parser/three
46251040
ns/iter (± 126315
)47350773
ns/iter (± 179302
)0.98
es/parser/yui
8213383
ns/iter (± 22007
)8392786
ns/iter (± 32339
)0.98
es/preset-env/usage/builtin_type
134987
ns/iter (± 31204
)137660
ns/iter (± 32599
)0.98
es/preset-env/usage/property
16585
ns/iter (± 47
)17059
ns/iter (± 45
)0.97
es/resolver/typescript
90323700
ns/iter (± 945550
)90567224
ns/iter (± 1801288
)1.00
es/fixer/typescript
61776922
ns/iter (± 304281
)64449697
ns/iter (± 1977461
)0.96
es/hygiene/typescript
127962658
ns/iter (± 811728
)131589918
ns/iter (± 711874
)0.97
es/resolver_with_hygiene/typescript
242209076
ns/iter (± 817999
)242453713
ns/iter (± 991759
)1.00
es/visitor/base-perf/module_clone
59538
ns/iter (± 276
)58617
ns/iter (± 520
)1.02
es/visitor/base-perf/fold_empty
63278
ns/iter (± 406
)62776
ns/iter (± 377
)1.01
es/visitor/base-perf/fold_noop_impl_all
63713
ns/iter (± 209
)62842
ns/iter (± 310
)1.01
es/visitor/base-perf/fold_noop_impl_vec
64051
ns/iter (± 379
)62662
ns/iter (± 175
)1.02
es/visitor/base-perf/boxing_boxed_clone
59
ns/iter (± 0
)56
ns/iter (± 0
)1.05
es/visitor/base-perf/boxing_unboxed_clone
39
ns/iter (± 0
)39
ns/iter (± 0
)1
es/visitor/base-perf/boxing_boxed
110
ns/iter (± 0
)110
ns/iter (± 0
)1
es/visitor/base-perf/boxing_unboxed
77
ns/iter (± 0
)77
ns/iter (± 0
)1
es/visitor/base-perf/visit_empty
0
ns/iter (± 0
)0
ns/iter (± 0
)NaN
es/visitor/base-perf/visit_contains_this
2432
ns/iter (± 10
)2523
ns/iter (± 25
)0.96
es/base/parallel/resolver/typescript
3742564513
ns/iter (± 321996582
)3864096578
ns/iter (± 267759037
)0.97
es/base/parallel/hygiene/typescript
1442586867
ns/iter (± 13333550
)1480515213
ns/iter (± 10855884
)0.97
misc/visitors/time-complexity/time 5
134
ns/iter (± 3
)150
ns/iter (± 0
)0.89
misc/visitors/time-complexity/time 10
355
ns/iter (± 1
)324
ns/iter (± 4
)1.10
misc/visitors/time-complexity/time 15
669
ns/iter (± 3
)878
ns/iter (± 0
)0.76
misc/visitors/time-complexity/time 20
1126
ns/iter (± 15
)1283
ns/iter (± 30
)0.88
misc/visitors/time-complexity/time 40
3565
ns/iter (± 7
)4363
ns/iter (± 2
)0.82
misc/visitors/time-complexity/time 60
7444
ns/iter (± 33
)9032
ns/iter (± 18
)0.82
This comment was automatically generated by workflow using github-action-benchmark.