-
-
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/codegen): Preserve parens for
new
in optional chaining (#6484)
- Loading branch information
1 parent
66b4966
commit 1ca281a
Showing
4 changed files
with
81 additions
and
6 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,72 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript", | ||
"tsx": true | ||
}, | ||
"transform": { | ||
"react": { | ||
"runtime": "automatic", | ||
"importSource": "preact", | ||
"development": true | ||
} | ||
}, | ||
"target": "es2022", | ||
"loose": false, | ||
"minify": { | ||
"compress": { | ||
"arguments": false, | ||
"arrows": true, | ||
"booleans": true, | ||
"booleans_as_integers": false, | ||
"collapse_vars": true, | ||
"comparisons": true, | ||
"computed_props": true, | ||
"conditionals": true, | ||
"dead_code": true, | ||
"directives": true, | ||
"drop_console": false, | ||
"drop_debugger": true, | ||
"evaluate": true, | ||
"expression": false, | ||
"hoist_funs": false, | ||
"hoist_props": true, | ||
"hoist_vars": false, | ||
"if_return": true, | ||
"join_vars": true, | ||
"keep_classnames": false, | ||
"keep_fargs": true, | ||
"keep_fnames": false, | ||
"keep_infinity": false, | ||
"loops": true, | ||
"negate_iife": true, | ||
"properties": true, | ||
"reduce_funcs": false, | ||
"reduce_vars": false, | ||
"side_effects": true, | ||
"switches": true, | ||
"typeofs": true, | ||
"unsafe": false, | ||
"unsafe_arrows": false, | ||
"unsafe_comps": false, | ||
"unsafe_Function": false, | ||
"unsafe_math": false, | ||
"unsafe_symbols": false, | ||
"unsafe_methods": false, | ||
"unsafe_proto": false, | ||
"unsafe_regexp": false, | ||
"unsafe_undefined": false, | ||
"unused": true, | ||
"const_to_let": true, | ||
"pristine_globals": true, | ||
"passes": 2 | ||
}, | ||
"mangle": false | ||
} | ||
}, | ||
"module": { | ||
"type": "es6" | ||
}, | ||
"minify": true, | ||
"isModule": true | ||
} |
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 @@ | ||
new Date()?.toLocaleDateString() |
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 @@ | ||
new Date()?.toLocaleDateString(); |
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
1ca281a
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
358335
ns/iter (± 26445
)374285
ns/iter (± 24614
)0.96
es/full/minify/libraries/antd
1959227523
ns/iter (± 38368445
)2009259990
ns/iter (± 40646178
)0.98
es/full/minify/libraries/d3
441250229
ns/iter (± 27160675
)430972970
ns/iter (± 12555504
)1.02
es/full/minify/libraries/echarts
1593756810
ns/iter (± 25329724
)1662554773
ns/iter (± 23161288
)0.96
es/full/minify/libraries/jquery
106409232
ns/iter (± 3129500
)106754203
ns/iter (± 4099451
)1.00
es/full/minify/libraries/lodash
131384339
ns/iter (± 16311308
)137363179
ns/iter (± 8907230
)0.96
es/full/minify/libraries/moment
62782646
ns/iter (± 3190796
)67505846
ns/iter (± 2041159
)0.93
es/full/minify/libraries/react
24060321
ns/iter (± 3029373
)22600132
ns/iter (± 1324463
)1.06
es/full/minify/libraries/terser
384910896
ns/iter (± 97191202
)353253471
ns/iter (± 7715785
)1.09
es/full/minify/libraries/three
593173907
ns/iter (± 75327624
)616425752
ns/iter (± 10261402
)0.96
es/full/minify/libraries/typescript
3452702783
ns/iter (± 42552357
)3714122264
ns/iter (± 86495381
)0.93
es/full/minify/libraries/victory
846944571
ns/iter (± 19298761
)875264815
ns/iter (± 25279076
)0.97
es/full/minify/libraries/vue
165847087
ns/iter (± 17970823
)168591942
ns/iter (± 4272102
)0.98
es/full/codegen/es3
34160
ns/iter (± 923
)35041
ns/iter (± 2859
)0.97
es/full/codegen/es5
34009
ns/iter (± 918
)34826
ns/iter (± 1843
)0.98
es/full/codegen/es2015
33914
ns/iter (± 2471
)34510
ns/iter (± 1941
)0.98
es/full/codegen/es2016
34060
ns/iter (± 1403
)34866
ns/iter (± 3230
)0.98
es/full/codegen/es2017
33991
ns/iter (± 1013
)35244
ns/iter (± 3399
)0.96
es/full/codegen/es2018
34018
ns/iter (± 796
)34830
ns/iter (± 3021
)0.98
es/full/codegen/es2019
34001
ns/iter (± 1149
)34946
ns/iter (± 6448
)0.97
es/full/codegen/es2020
34099
ns/iter (± 906
)35269
ns/iter (± 1905
)0.97
es/full/all/es3
197741490
ns/iter (± 11255192
)206383691
ns/iter (± 12014761
)0.96
es/full/all/es5
182518002
ns/iter (± 11445401
)192097152
ns/iter (± 7633575
)0.95
es/full/all/es2015
144805537
ns/iter (± 14450150
)156620071
ns/iter (± 10149761
)0.92
es/full/all/es2016
149935018
ns/iter (± 15651195
)155846925
ns/iter (± 10365733
)0.96
es/full/all/es2017
166111431
ns/iter (± 19211682
)156069905
ns/iter (± 10071350
)1.06
es/full/all/es2018
158962239
ns/iter (± 15091410
)152076254
ns/iter (± 10577652
)1.05
es/full/all/es2019
142850838
ns/iter (± 9250643
)150651751
ns/iter (± 12613714
)0.95
es/full/all/es2020
137419726
ns/iter (± 7020541
)147469465
ns/iter (± 11532949
)0.93
es/full/parser
723183
ns/iter (± 60130
)754708
ns/iter (± 50669
)0.96
es/full/base/fixer
26339
ns/iter (± 937
)28089
ns/iter (± 3589
)0.94
es/full/base/resolver_and_hygiene
92400
ns/iter (± 5831
)95214
ns/iter (± 9003
)0.97
serialization of ast node
207
ns/iter (± 16
)232
ns/iter (± 37
)0.89
serialization of serde
213
ns/iter (± 15
)228
ns/iter (± 24
)0.93
This comment was automatically generated by workflow using github-action-benchmark.