-
-
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): Check if object shorthand is skippable for seq inli…
- Loading branch information
Showing
3 changed files
with
46 additions
and
30 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
17 changes: 17 additions & 0 deletions
17
crates/swc_ecma_minifier/tests/fixture/issues/7984/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,17 @@ | ||
getInitialProps = (code) => { | ||
let statusCode, message; | ||
|
||
if (code) { | ||
statusCode = code; | ||
} | ||
|
||
switch (statusCode) { | ||
case 404: | ||
message = "404"; | ||
break; | ||
default: | ||
message = "500"; | ||
} | ||
|
||
return { statusCode, message }; | ||
}; |
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,7 @@ | ||
getInitialProps = (code)=>{ | ||
let statusCode, message; | ||
return code && (statusCode = code), message = 404 === statusCode ? "404" : "500", { | ||
statusCode, | ||
message | ||
}; | ||
}; |
01391e3
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
278685
ns/iter (± 8799
)281753
ns/iter (± 8214
)0.99
es/full/minify/libraries/antd
1306400999
ns/iter (± 7553557
)1310902953
ns/iter (± 6290217
)1.00
es/full/minify/libraries/d3
280564034
ns/iter (± 4398582
)276267250
ns/iter (± 4052925
)1.02
es/full/minify/libraries/echarts
1050579974
ns/iter (± 18955008
)1068183291
ns/iter (± 24378636
)0.98
es/full/minify/libraries/jquery
84228909
ns/iter (± 211767
)83842395
ns/iter (± 312468
)1.00
es/full/minify/libraries/lodash
97849488
ns/iter (± 386897
)97117168
ns/iter (± 457172
)1.01
es/full/minify/libraries/moment
50011759
ns/iter (± 77942
)50227921
ns/iter (± 141711
)1.00
es/full/minify/libraries/react
18061141
ns/iter (± 28242
)17986911
ns/iter (± 69693
)1.00
es/full/minify/libraries/terser
217781149
ns/iter (± 785750
)217090952
ns/iter (± 564132
)1.00
es/full/minify/libraries/three
384443615
ns/iter (± 2360071
)383859496
ns/iter (± 1302227
)1.00
es/full/minify/libraries/typescript
2638394815
ns/iter (± 10720442
)2642355444
ns/iter (± 16280606
)1.00
es/full/minify/libraries/victory
565654261
ns/iter (± 5060400
)562936170
ns/iter (± 8543489
)1.00
es/full/minify/libraries/vue
119507821
ns/iter (± 981115
)119196850
ns/iter (± 380357
)1.00
es/full/codegen/es3
34122
ns/iter (± 99
)34217
ns/iter (± 137
)1.00
es/full/codegen/es5
34013
ns/iter (± 390
)34228
ns/iter (± 45
)0.99
es/full/codegen/es2015
34157
ns/iter (± 86
)34376
ns/iter (± 1709
)0.99
es/full/codegen/es2016
34072
ns/iter (± 85
)34225
ns/iter (± 125
)1.00
es/full/codegen/es2017
33967
ns/iter (± 131
)34247
ns/iter (± 55
)0.99
es/full/codegen/es2018
34195
ns/iter (± 254
)34321
ns/iter (± 133
)1.00
es/full/codegen/es2019
34235
ns/iter (± 116
)34352
ns/iter (± 62
)1.00
es/full/codegen/es2020
34272
ns/iter (± 146
)34201
ns/iter (± 51
)1.00
es/full/all/es3
165339227
ns/iter (± 1567430
)165378325
ns/iter (± 495175
)1.00
es/full/all/es5
157435136
ns/iter (± 726426
)157742655
ns/iter (± 863676
)1.00
es/full/all/es2015
116426100
ns/iter (± 505324
)117999119
ns/iter (± 868427
)0.99
es/full/all/es2016
116052403
ns/iter (± 763786
)116922708
ns/iter (± 758007
)0.99
es/full/all/es2017
115111908
ns/iter (± 897604
)116568097
ns/iter (± 2323613
)0.99
es/full/all/es2018
113507113
ns/iter (± 676021
)114292795
ns/iter (± 612608
)0.99
es/full/all/es2019
112016010
ns/iter (± 880499
)113934104
ns/iter (± 696130
)0.98
es/full/all/es2020
108530499
ns/iter (± 361150
)109367898
ns/iter (± 353843
)0.99
es/full/parser
484037
ns/iter (± 5246
)491699
ns/iter (± 6408
)0.98
es/full/base/fixer
20314
ns/iter (± 191
)17924
ns/iter (± 65
)1.13
es/full/base/resolver_and_hygiene
82457
ns/iter (± 150
)80678
ns/iter (± 214
)1.02
serialization of serde
291
ns/iter (± 2
)287
ns/iter (± 0
)1.01
This comment was automatically generated by workflow using github-action-benchmark.