-
-
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.
feat(es/compat): Skip empty class static blocks (#8138)
**Description:** And update the `static_block_private_id` generate rules to be consistent with Babel. **Related issue:** - #8136
- Loading branch information
1 parent
34b0167
commit e186b80
Showing
16 changed files
with
61 additions
and
94 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 |
---|---|---|
|
@@ -13,9 +13,3 @@ var __5 = { | |
writable: true, | ||
value: 1 | ||
}; | ||
(()=>{})(); | ||
(()=>{})(); | ||
(()=>{})(); | ||
(()=>{})(); | ||
(()=>{})(); | ||
(()=>{})(); |
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
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 |
---|---|---|
|
@@ -4,6 +4,3 @@ var C = function C() { | |
"use strict"; | ||
_class_call_check(this, C); | ||
}; | ||
(function() { | ||
// something | ||
})(); |
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
1 change: 0 additions & 1 deletion
1
crates/swc_ecma_transforms_compat/tests/static-blocks/basic/export-default/output.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,4 +1,3 @@ | ||
export default class Foo { | ||
#foo; | ||
static #_ = (()=>{})(); | ||
} |
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_compat/tests/static-blocks/basic/name-conflicts01/output.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,4 +1,4 @@ | ||
class Foo { | ||
static #_ = 42; | ||
static #_1 = this.foo = this.#_; | ||
static #_2 = this.foo = this.#_; | ||
} |
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 |
---|---|---|
|
@@ -23,7 +23,7 @@ var __ = { | |
classDec | ||
]) | ||
}; | ||
var __1 = { | ||
var __2 = { | ||
writable: true, | ||
value: _initClass() | ||
}; |
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 |
---|---|---|
|
@@ -24,7 +24,7 @@ var __ = { | |
classDec | ||
]) | ||
}; | ||
var __1 = { | ||
var __2 = { | ||
writable: true, | ||
value: _initClass() | ||
}; |
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
Oops, something went wrong.
e186b80
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
282550
ns/iter (± 7717
)284101
ns/iter (± 5089
)0.99
es/full/minify/libraries/antd
1384373816
ns/iter (± 19517629
)1402131384
ns/iter (± 13074805
)0.99
es/full/minify/libraries/d3
291684503
ns/iter (± 2637807
)295972404
ns/iter (± 2395737
)0.99
es/full/minify/libraries/echarts
1107930076
ns/iter (± 6037957
)1129919682
ns/iter (± 4272904
)0.98
es/full/minify/libraries/jquery
88911549
ns/iter (± 918564
)89298718
ns/iter (± 208814
)1.00
es/full/minify/libraries/lodash
103603119
ns/iter (± 315351
)104544053
ns/iter (± 266372
)0.99
es/full/minify/libraries/moment
52161073
ns/iter (± 76455
)52651896
ns/iter (± 107827
)0.99
es/full/minify/libraries/react
18828503
ns/iter (± 52955
)18967284
ns/iter (± 110836
)0.99
es/full/minify/libraries/terser
229079800
ns/iter (± 1565967
)230975986
ns/iter (± 825561
)0.99
es/full/minify/libraries/three
411031599
ns/iter (± 2178496
)413013854
ns/iter (± 2520735
)1.00
es/full/minify/libraries/typescript
2792299928
ns/iter (± 7248821
)2792014299
ns/iter (± 7520902
)1.00
es/full/minify/libraries/victory
594477849
ns/iter (± 5600441
)599994242
ns/iter (± 2696170
)0.99
es/full/minify/libraries/vue
125406477
ns/iter (± 533624
)128628100
ns/iter (± 1047610
)0.97
es/full/codegen/es3
33266
ns/iter (± 83
)35326
ns/iter (± 143
)0.94
es/full/codegen/es5
33251
ns/iter (± 121
)35517
ns/iter (± 146
)0.94
es/full/codegen/es2015
33262
ns/iter (± 101
)35375
ns/iter (± 97
)0.94
es/full/codegen/es2016
33201
ns/iter (± 64
)35429
ns/iter (± 40
)0.94
es/full/codegen/es2017
33225
ns/iter (± 179
)35361
ns/iter (± 98
)0.94
es/full/codegen/es2018
33169
ns/iter (± 76
)35489
ns/iter (± 171
)0.93
es/full/codegen/es2019
33254
ns/iter (± 66
)35412
ns/iter (± 127
)0.94
es/full/codegen/es2020
33198
ns/iter (± 70
)35461
ns/iter (± 125
)0.94
es/full/all/es3
177186202
ns/iter (± 1240760
)176745682
ns/iter (± 1104320
)1.00
es/full/all/es5
170003284
ns/iter (± 774839
)169236775
ns/iter (± 1105646
)1.00
es/full/all/es2015
130917469
ns/iter (± 5958145
)128214840
ns/iter (± 694454
)1.02
es/full/all/es2016
127629620
ns/iter (± 917737
)126746080
ns/iter (± 878373
)1.01
es/full/all/es2017
127703572
ns/iter (± 1340654
)126127936
ns/iter (± 680482
)1.01
es/full/all/es2018
125494822
ns/iter (± 345831
)124531356
ns/iter (± 668499
)1.01
es/full/all/es2019
125101983
ns/iter (± 1004671
)123807639
ns/iter (± 840679
)1.01
es/full/all/es2020
120896160
ns/iter (± 377928
)120288284
ns/iter (± 819585
)1.01
es/full/parser
562199
ns/iter (± 4451
)565911
ns/iter (± 3729
)0.99
es/full/base/fixer
17652
ns/iter (± 44
)19239
ns/iter (± 265
)0.92
es/full/base/resolver_and_hygiene
85003
ns/iter (± 571
)84076
ns/iter (± 206
)1.01
This comment was automatically generated by workflow using github-action-benchmark.