Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(es/compat): Support readonly and writeonly for private fields (#…
- Loading branch information
Showing
22 changed files
with
290 additions
and
125 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
12 changes: 6 additions & 6 deletions
12
crates/swc/tests/tsc-references/privateNameMethodAssignment.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
4 changes: 2 additions & 2 deletions
4
crates/swc/tests/tsc-references/privateNameReadonly.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
4 changes: 2 additions & 2 deletions
4
crates/swc/tests/tsc-references/privateNameReadonly.2.minified.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
4 changes: 2 additions & 2 deletions
4
crates/swc/tests/tsc-references/privateNameSetterNoGetter.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
4 changes: 2 additions & 2 deletions
4
crates/swc/tests/tsc-references/privateNameSetterNoGetter.2.minified.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
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_base/src/helpers/_class_apply_descriptor_update.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
2 changes: 1 addition & 1 deletion
2
crates/swc_ecma_transforms_base/src/helpers/_read_only_error.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
function _readOnlyError(name) { | ||
throw new Error("\"" + name + "\" is read-only"); | ||
throw new TypeError("\"" + name + "\" is read-only"); | ||
} |
3 changes: 3 additions & 0 deletions
3
crates/swc_ecma_transforms_base/src/helpers/_write_only_error.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,3 @@ | ||
function _writeOnlyError(name) { | ||
throw new TypeError("\"" + name + "\" is write-only"); | ||
} |
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.
aefc11b
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
1748109688
ns/iter (± 17480335
)2485867065
ns/iter (± 159117675
)0.70
es/full/minify/libraries/d3
363397620
ns/iter (± 9193663
)516855354
ns/iter (± 47232410
)0.70
es/full/minify/libraries/echarts
1481507695
ns/iter (± 10605396
)2099595453
ns/iter (± 417552009
)0.71
es/full/minify/libraries/jquery
94386628
ns/iter (± 1680940
)162413743
ns/iter (± 19707900
)0.58
es/full/minify/libraries/lodash
107645520
ns/iter (± 1616422
)230163549
ns/iter (± 790197817
)0.47
es/full/minify/libraries/moment
54794340
ns/iter (± 826143
)82876284
ns/iter (± 26986994
)0.66
es/full/minify/libraries/react
18871283
ns/iter (± 366698
)26866982
ns/iter (± 3402301
)0.70
es/full/minify/libraries/terser
283483870
ns/iter (± 7607016
)463832480
ns/iter (± 277141856
)0.61
es/full/minify/libraries/three
524268008
ns/iter (± 13909328
)747342130
ns/iter (± 1147585187
)0.70
es/full/minify/libraries/typescript
3249166309
ns/iter (± 30481272
)4534278015
ns/iter (± 553923193
)0.72
es/full/minify/libraries/victory
771717290
ns/iter (± 11779978
)1032825615
ns/iter (± 114218453
)0.75
es/full/minify/libraries/vue
134482843
ns/iter (± 2097866
)233975306
ns/iter (± 21828558
)0.57
es/full/codegen/es3
32981
ns/iter (± 839
)51360
ns/iter (± 7187
)0.64
es/full/codegen/es5
33087
ns/iter (± 1212
)48971
ns/iter (± 13859
)0.68
es/full/codegen/es2015
33131
ns/iter (± 1707
)41280
ns/iter (± 6505
)0.80
es/full/codegen/es2016
32986
ns/iter (± 1043
)43398
ns/iter (± 6710
)0.76
es/full/codegen/es2017
33028
ns/iter (± 586
)49587
ns/iter (± 16148
)0.67
es/full/codegen/es2018
33112
ns/iter (± 410
)56675
ns/iter (± 20585
)0.58
es/full/codegen/es2019
33275
ns/iter (± 587
)55821
ns/iter (± 141062
)0.60
es/full/codegen/es2020
33022
ns/iter (± 991
)49395
ns/iter (± 10632
)0.67
es/full/all/es3
183541605
ns/iter (± 3262227
)328661105
ns/iter (± 926742030
)0.56
es/full/all/es5
174501016
ns/iter (± 2897174
)279355594
ns/iter (± 114340260
)0.62
es/full/all/es2015
140091322
ns/iter (± 3273654
)252875509
ns/iter (± 327975522
)0.55
es/full/all/es2016
139238713
ns/iter (± 3080109
)227626657
ns/iter (± 34693216
)0.61
es/full/all/es2017
138780063
ns/iter (± 3019447
)201369801
ns/iter (± 25238879
)0.69
es/full/all/es2018
136903211
ns/iter (± 4037907
)172894782
ns/iter (± 22920134
)0.79
es/full/all/es2019
136341740
ns/iter (± 3855380
)194881428
ns/iter (± 31590823
)0.70
es/full/all/es2020
132001929
ns/iter (± 2968557
)199988019
ns/iter (± 40526358
)0.66
es/full/parser
690502
ns/iter (± 23773
)1108369
ns/iter (± 292773
)0.62
es/full/base/fixer
24856
ns/iter (± 369
)35748
ns/iter (± 5385
)0.70
es/full/base/resolver_and_hygiene
89474
ns/iter (± 1416
)122014
ns/iter (± 17063
)0.73
serialization of ast node
204
ns/iter (± 5
)276
ns/iter (± 43
)0.74
serialization of serde
219
ns/iter (± 6
)312
ns/iter (± 52
)0.70
This comment was automatically generated by workflow using github-action-benchmark.