-
-
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/minifier): Don't evaluate
String.fromCharCode
for non-ascii …
…values (#6033)
- Loading branch information
Showing
7 changed files
with
55 additions
and
14 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
11 changes: 11 additions & 0 deletions
11
crates/swc_ecma_minifier/tests/fixture/next/feedback-regex/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,11 @@ | ||
export const rtlRegEx = new RegExp( | ||
/* eslint-disable prettier/prettier */ | ||
'[' + | ||
String.fromCharCode(0x00591) + '-' + String.fromCharCode(0x008ff) + | ||
String.fromCharCode(0x0fb1d) + '-' + String.fromCharCode(0x0fdff) + | ||
String.fromCharCode(0x0fe70) + '-' + String.fromCharCode(0x0fefc) + | ||
String.fromCharCode(0x10800) + '-' + String.fromCharCode(0x10fff) + | ||
String.fromCharCode(0x1e800) + '-' + String.fromCharCode(0x1efff) + | ||
']' | ||
/* eslint-enable prettier/prettier */ | ||
); |
1 change: 1 addition & 0 deletions
1
crates/swc_ecma_minifier/tests/fixture/next/feedback-regex/output.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
197c4e2
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
2015599464
ns/iter (± 68035698
)1938069534
ns/iter (± 191017062
)1.04
es/full/minify/libraries/d3
400699807
ns/iter (± 28182827
)381110153
ns/iter (± 33381537
)1.05
es/full/minify/libraries/echarts
1540969393
ns/iter (± 88508515
)1487816765
ns/iter (± 99087614
)1.04
es/full/minify/libraries/jquery
106640398
ns/iter (± 9723597
)92672060
ns/iter (± 13975938
)1.15
es/full/minify/libraries/lodash
141184190
ns/iter (± 16966109
)116728366
ns/iter (± 2923842
)1.21
es/full/minify/libraries/moment
60853783
ns/iter (± 5570227
)53112963
ns/iter (± 1393704
)1.15
es/full/minify/libraries/react
22783319
ns/iter (± 4277129
)20345586
ns/iter (± 2672636
)1.12
es/full/minify/libraries/terser
323756296
ns/iter (± 15545763
)298616799
ns/iter (± 36710174
)1.08
es/full/minify/libraries/three
522546434
ns/iter (± 16136740
)546508982
ns/iter (± 414745557
)0.96
es/full/minify/libraries/typescript
3512655795
ns/iter (± 186948066
)3368334246
ns/iter (± 132620049
)1.04
es/full/minify/libraries/victory
969085923
ns/iter (± 353575210
)791008956
ns/iter (± 120251038
)1.23
es/full/minify/libraries/vue
157653496
ns/iter (± 13527087
)138259070
ns/iter (± 15871191
)1.14
es/full/codegen/es3
34657
ns/iter (± 2601
)34151
ns/iter (± 1794
)1.01
es/full/codegen/es5
34895
ns/iter (± 5754
)34108
ns/iter (± 5022
)1.02
es/full/codegen/es2015
34741
ns/iter (± 4841
)33935
ns/iter (± 1344
)1.02
es/full/codegen/es2016
34159
ns/iter (± 5076
)33966
ns/iter (± 1820
)1.01
es/full/codegen/es2017
34763
ns/iter (± 4637
)33755
ns/iter (± 964
)1.03
es/full/codegen/es2018
35408
ns/iter (± 8271
)34206
ns/iter (± 9638
)1.04
es/full/codegen/es2019
34925
ns/iter (± 4992
)34123
ns/iter (± 1032
)1.02
es/full/codegen/es2020
34294
ns/iter (± 2736
)33751
ns/iter (± 1832
)1.02
es/full/all/es3
225232780
ns/iter (± 18837357
)198851563
ns/iter (± 23229565
)1.13
es/full/all/es5
210118684
ns/iter (± 18050430
)187149203
ns/iter (± 20290404
)1.12
es/full/all/es2015
162146384
ns/iter (± 15500366
)151784906
ns/iter (± 15687342
)1.07
es/full/all/es2016
163314876
ns/iter (± 14106843
)150974991
ns/iter (± 17550174
)1.08
es/full/all/es2017
160584253
ns/iter (± 17186508
)149988091
ns/iter (± 21528681
)1.07
es/full/all/es2018
146837027
ns/iter (± 14226079
)148765985
ns/iter (± 19253442
)0.99
es/full/all/es2019
163364984
ns/iter (± 18255459
)148101573
ns/iter (± 19670829
)1.10
es/full/all/es2020
138415607
ns/iter (± 12609983
)143943377
ns/iter (± 16754786
)0.96
es/full/parser
721402
ns/iter (± 14129
)761322
ns/iter (± 54220
)0.95
es/full/base/fixer
25873
ns/iter (± 608
)26925
ns/iter (± 3445
)0.96
es/full/base/resolver_and_hygiene
94577
ns/iter (± 2948
)95319
ns/iter (± 7481
)0.99
serialization of ast node
219
ns/iter (± 7
)219
ns/iter (± 20
)1
serialization of serde
220
ns/iter (± 3
)222
ns/iter (± 13
)0.99
This comment was automatically generated by workflow using github-action-benchmark.