-
-
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/resolver): Fix handling of block scoped functions (#5092)
- Loading branch information
Showing
35 changed files
with
830 additions
and
280 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
crates/swc/tests/errors/lints/duplicate-bindings/function/1/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,6 @@ | ||
try { | ||
var fx | ||
function fx(){} | ||
} catch { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
crates/swc/tests/errors/lints/duplicate-bindings/function/1/output.swc-stderr
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 @@ | ||
|
||
x the name `fx` is defined multiple times | ||
,-[2:5] | ||
2 | var fx | ||
: ^| | ||
: `-- previous definition of `fx` here | ||
3 | function fx(){} | ||
: ^| | ||
: `-- `fx` redefined here | ||
`---- |
5 changes: 5 additions & 0 deletions
5
crates/swc/tests/errors/lints/duplicate-bindings/function/2/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,5 @@ | ||
switch (a) { | ||
case 'a': | ||
var foo | ||
function foo() {} | ||
} |
10 changes: 10 additions & 0 deletions
10
crates/swc/tests/errors/lints/duplicate-bindings/function/2/output.swc-stderr
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 @@ | ||
|
||
x the name `foo` is defined multiple times | ||
,-[3:7] | ||
3 | var foo | ||
: ^|^ | ||
: `-- previous definition of `foo` here | ||
4 | function foo() {} | ||
: ^|^ | ||
: `-- `foo` redefined here | ||
`---- |
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,6 @@ | ||
export class A { | ||
static { | ||
var fx | ||
function fx(){} | ||
} | ||
} |
Oops, something went wrong.
9519e80
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/minify/libraries/antd
1703854935
ns/iter (± 57056341
)1645568957
ns/iter (± 20887065
)1.04
es/full/minify/libraries/d3
435443046
ns/iter (± 12065822
)409586322
ns/iter (± 10587627
)1.06
es/full/minify/libraries/echarts
1651395465
ns/iter (± 19113364
)1613964429
ns/iter (± 23749483
)1.02
es/full/minify/libraries/jquery
101176375
ns/iter (± 8090664
)88593617
ns/iter (± 2852172
)1.14
es/full/minify/libraries/lodash
142153710
ns/iter (± 7054915
)123223614
ns/iter (± 8104909
)1.15
es/full/minify/libraries/moment
54679707
ns/iter (± 3965279
)57572524
ns/iter (± 2470404
)0.95
es/full/minify/libraries/react
19362959
ns/iter (± 1230351
)18979194
ns/iter (± 601944
)1.02
es/full/minify/libraries/terser
601833366
ns/iter (± 9812263
)596416211
ns/iter (± 9483327
)1.01
es/full/minify/libraries/three
550510339
ns/iter (± 5306246
)538408911
ns/iter (± 9380599
)1.02
es/full/minify/libraries/typescript
3586070227
ns/iter (± 49464644
)3402142739
ns/iter (± 64459217
)1.05
es/full/minify/libraries/victory
720875948
ns/iter (± 7730871
)704827816
ns/iter (± 10928979
)1.02
es/full/minify/libraries/vue
141706800
ns/iter (± 4365427
)131182834
ns/iter (± 4165899
)1.08
es/full/codegen/es3
32215
ns/iter (± 365
)31180
ns/iter (± 636
)1.03
es/full/codegen/es5
32421
ns/iter (± 907
)31251
ns/iter (± 779
)1.04
es/full/codegen/es2015
32319
ns/iter (± 335
)31202
ns/iter (± 1753
)1.04
es/full/codegen/es2016
32311
ns/iter (± 730
)31286
ns/iter (± 1127
)1.03
es/full/codegen/es2017
32595
ns/iter (± 1204
)31214
ns/iter (± 1544
)1.04
es/full/codegen/es2018
32661
ns/iter (± 1711
)31321
ns/iter (± 729
)1.04
es/full/codegen/es2019
32363
ns/iter (± 656
)31305
ns/iter (± 909
)1.03
es/full/codegen/es2020
32542
ns/iter (± 713
)31681
ns/iter (± 346
)1.03
es/full/all/es3
179929695
ns/iter (± 8015810
)187827533
ns/iter (± 4162476
)0.96
es/full/all/es5
173238934
ns/iter (± 6093248
)177806990
ns/iter (± 4975691
)0.97
es/full/all/es2015
145498174
ns/iter (± 12831272
)144996657
ns/iter (± 6308711
)1.00
es/full/all/es2016
144401540
ns/iter (± 4936729
)144627665
ns/iter (± 4798638
)1.00
es/full/all/es2017
143211317
ns/iter (± 4982326
)144693521
ns/iter (± 4574964
)0.99
es/full/all/es2018
144238547
ns/iter (± 5157975
)145268118
ns/iter (± 4670133
)0.99
es/full/all/es2019
141589870
ns/iter (± 5010692
)143915531
ns/iter (± 4705254
)0.98
es/full/all/es2020
142000306
ns/iter (± 4042826
)131923862
ns/iter (± 3104832
)1.08
es/full/parser
719839
ns/iter (± 17517
)761028
ns/iter (± 56598
)0.95
es/full/base/fixer
30323
ns/iter (± 573
)28793
ns/iter (± 2972
)1.05
es/full/base/resolver_and_hygiene
87777
ns/iter (± 3506
)87979
ns/iter (± 1405
)1.00
serialization of ast node
213
ns/iter (± 5
)215
ns/iter (± 3
)0.99
serialization of serde
227
ns/iter (± 2
)228
ns/iter (± 5
)1.00
This comment was automatically generated by workflow using github-action-benchmark.