Skip to content

Commit 38bc710

Browse files
authoredSep 27, 2023
fix(es/compat): Use return statements for method and setter decorator (#8017)
**Description:** This aligns with other implementations such as TypeScript's and correctly implements the currently proposed behavior. **Related issue:** - Closes #8015.
1 parent 0871d4e commit 38bc710

File tree

24 files changed

+101
-68
lines changed

24 files changed

+101
-68
lines changed
 

‎crates/swc_ecma_transforms_proposal/src/decorator_2022_03.rs

+12-15
Original file line numberDiff line numberDiff line change
@@ -850,18 +850,15 @@ impl VisitMut for Decorator202203 {
850850

851851
match p.kind {
852852
MethodKind::Method => {
853-
*n = ClassMember::PrivateProp(PrivateProp {
854-
accessibility: Default::default(),
855-
span: p.span,
856-
key: p.key.clone(),
857-
is_optional: Default::default(),
858-
is_override: Default::default(),
859-
is_static: p.is_static,
860-
value: Some(init.into()),
861-
type_ann: Default::default(),
862-
decorators: Default::default(),
863-
definite: Default::default(),
864-
readonly: Default::default(),
853+
let call_stmt = Stmt::Return(ReturnStmt {
854+
span: DUMMY_SP,
855+
arg: Some(Box::new(Expr::Ident(init))),
856+
});
857+
858+
p.kind = MethodKind::Getter;
859+
p.function.body = Some(BlockStmt {
860+
span: DUMMY_SP,
861+
stmts: vec![call_stmt],
865862
});
866863
}
867864
MethodKind::Getter => {
@@ -881,17 +878,17 @@ impl VisitMut for Decorator202203 {
881878
});
882879
}
883880
MethodKind::Setter => {
884-
let call_stmt = Stmt::Expr(ExprStmt {
881+
let call_stmt = Stmt::Return(ReturnStmt {
885882
span: DUMMY_SP,
886-
expr: Box::new(Expr::Call(CallExpr {
883+
arg: Some(Box::new(Expr::Call(CallExpr {
887884
span: DUMMY_SP,
888885
callee: init.as_callee(),
889886
args: vec![
890887
ThisExpr { span: DUMMY_SP }.as_arg(),
891888
p.function.params[0].pat.clone().expect_ident().id.as_arg(),
892889
],
893890
type_args: Default::default(),
894-
})),
891+
}))),
895892
});
896893

897894
p.function.body = Some(BlockStmt {

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters--to-es2015/private/output.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ function get_a() {
4242
return _call_a(this);
4343
}
4444
function set_a(v) {
45-
_call_a1(this, v);
45+
return _call_a1(this, v);
4646
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters--to-es2015/static-private/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var _a = {
1515
var __ = {
1616
writable: true,
1717
value: (()=>{
18-
({ e: [_call_a, _call_a1, _initStatic] } = _apply_decs_2203_r(Foo, [
18+
({ e: [_call_a, _call_a1, _initStatic] } = _apply_decs_2203_r(Foo, [
1919
[
2020
dec,
2121
8,
@@ -41,5 +41,5 @@ function get_a() {
4141
return _call_a(this);
4242
}
4343
function set_a(v) {
44-
_call_a1(this, v);
44+
return _call_a1(this, v);
4545
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters/private/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _call_a, _call_a1, _initProto;
22
const dec = ()=>{};
33
class Foo {
44
static{
5-
({ e: [_call_a, _call_a1, _initProto] } = _apply_decs_2203_r(this, [
5+
({ e: [_call_a, _call_a1, _initProto] } = _apply_decs_2203_r(this, [
66
[
77
dec,
88
3,
@@ -29,7 +29,7 @@ class Foo {
2929
return _call_a(this);
3030
}
3131
set #a(v) {
32-
_call_a1(this, v);
32+
return _call_a1(this, v);
3333
}
3434
getA() {
3535
return this.#a;

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-getters-and-setters/static-private/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _call_a, _call_a1, _initStatic;
22
const dec = ()=>{};
33
class Foo {
44
static{
5-
({ e: [_call_a, _call_a1, _initStatic] } = _apply_decs_2203_r(this, [
5+
({ e: [_call_a, _call_a1, _initStatic] } = _apply_decs_2203_r(this, [
66
[
77
dec,
88
8,
@@ -27,7 +27,7 @@ class Foo {
2727
return _call_a(this);
2828
}
2929
static set #a(v) {
30-
_call_a1(this, v);
30+
return _call_a1(this, v);
3131
}
3232
static getA() {
3333
return this.#a;

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/private/output.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ class Foo {
66
return _class_private_field_get(this, _a).call(this);
77
}
88
constructor(){
9-
_define_property(this, "value", 1);
109
_class_private_field_init(this, _a, {
11-
writable: true,
12-
value: _call_a
10+
get: get_a,
11+
set: void 0
1312
});
13+
_define_property(this, "value", 1);
1414
_initProto(this);
1515
}
1616
}
@@ -27,3 +27,6 @@ var __ = {
2727
]
2828
], [])
2929
};
30+
function get_a() {
31+
return _call_a;
32+
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods--to-es2015/static-private/output.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ class Foo {
55
return _class_static_private_field_spec_get(this, Foo, _a).call(Foo);
66
}
77
}
8+
var _a = {
9+
get: get_a,
10+
set: void 0
11+
};
812
var __ = {
913
writable: true,
1014
value: (()=>{
11-
({ e: [_call_a, _initStatic] } = _apply_decs_2203_r(Foo, [
15+
({ e: [_call_a, _initStatic] } = _apply_decs_2203_r(Foo, [
1216
[
1317
dec,
1418
7,
@@ -22,7 +26,6 @@ var __ = {
2226
})()
2327
};
2428
_define_property(Foo, "value", 1);
25-
var _a = {
26-
writable: true,
27-
value: _call_a
28-
};
29+
function get_a() {
30+
return _call_a;
31+
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods/private/output.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _call_a, _initProto;
22
const dec = ()=>{};
33
class Foo {
44
static{
5-
({ e: [_call_a, _initProto] } = _apply_decs_2203_r(this, [
5+
({ e: [_call_a, _initProto] } = _apply_decs_2203_r(this, [
66
[
77
dec,
88
2,
@@ -17,7 +17,9 @@ class Foo {
1717
_initProto(this);
1818
}
1919
value = 1;
20-
#a = _call_a;
20+
get #a() {
21+
return _call_a;
22+
}
2123
callA() {
2224
return this.#a();
2325
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-methods/static-private/output.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _call_a, _initStatic;
22
const dec = ()=>{};
33
class Foo {
44
static{
5-
({ e: [_call_a, _initStatic] } = _apply_decs_2203_r(this, [
5+
({ e: [_call_a, _initStatic] } = _apply_decs_2203_r(this, [
66
[
77
dec,
88
7,
@@ -15,7 +15,9 @@ class Foo {
1515
_initStatic(this);
1616
}
1717
static value = 1;
18-
static #a = _call_a;
18+
static get #a() {
19+
return _call_a;
20+
}
1921
static callA() {
2022
return this.#a();
2123
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/all-decorators/output.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ new class extends _identity {
88
static{
99
class Class {
1010
static{
11-
({ e: [_init_m, _call_o, _call_p, _call_q, _init_r, _get___r, _set___r, _init_i, _init_n, _init_d, _call_f, _call_g, _call_g1, _init_h, _get___h, _set___h, _init_a, _init_e, _initProto, _initStatic] , c: [_Class, _initClass] } = _apply_decs_2203_r(this, [
11+
({ e: [_init_m, _call_o, _call_p, _call_q, _init_r, _get___r, _set___r, _init_i, _init_n, _init_d, _call_f, _call_g, _call_g1, _init_h, _get___h, _set___h, _init_a, _init_e, _initProto, _initStatic], c: [_Class, _initClass] } = _apply_decs_2203_r(this, [
1212
[
1313
dec,
1414
7,
@@ -156,12 +156,14 @@ new class extends _identity {
156156
this.#___private_d = _v;
157157
}
158158
#e = _init_e(this);
159-
#f = _call_f;
159+
get #f() {
160+
return _call_f;
161+
}
160162
get #g() {
161163
return _call_g(this);
162164
}
163165
set #g(v) {
164-
_call_g1(this, v);
166+
return _call_g1(this, v);
165167
}
166168
#__h = _init_h(this);
167169
get #h() {
@@ -184,12 +186,14 @@ new class extends _identity {
184186
}
185187
#___private_m = _init_m(this);
186188
#n = _init_n(this);
187-
#o = _call_o;
189+
get #o() {
190+
return _call_o;
191+
}
188192
get #p() {
189193
return _call_p(this);
190194
}
191195
set #q(v) {
192-
_call_q(this, v);
196+
return _call_q(this, v);
193197
}
194198
#__r = _init_r(this);
195199
get #r() {

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-array-pattern/output.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _call_x, _initProto;
22
const dec = ()=>{};
33
class Foo {
44
static{
5-
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
5+
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
66
[
77
dec,
88
2,
@@ -14,7 +14,9 @@ class Foo {
1414
constructor(){
1515
_initProto(this);
1616
}
17-
#x = _call_x;
17+
get #x() {
18+
return _call_x;
19+
}
1820
bar() {
1921
[this.#x] = this.baz;
2022
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-for-of/output.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _call_x, _initProto;
22
const dec = ()=>{};
33
class Foo {
44
static{
5-
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
5+
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
66
[
77
dec,
88
2,
@@ -14,7 +14,9 @@ class Foo {
1414
constructor(){
1515
_initProto(this);
1616
}
17-
#x = _call_x;
17+
get #x() {
18+
return _call_x;
19+
}
1820
bar() {
1921
for (this.#x of this.baz);
2022
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-object-pattern/output.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _call_x, _initProto;
22
const dec = ()=>{};
33
class Foo {
44
static{
5-
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
5+
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
66
[
77
dec,
88
2,
@@ -14,8 +14,10 @@ class Foo {
1414
constructor(){
1515
_initProto(this);
1616
}
17-
#x = _call_x;
17+
get #x() {
18+
return _call_x;
19+
}
1820
bar() {
19-
({ x: this.#x } = this.baz);
21+
({ x: this.#x } = this.baz);
2022
}
2123
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-rest/output.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _call_x, _initProto;
22
const dec = ()=>{};
33
class Foo {
44
static{
5-
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
5+
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
66
[
77
dec,
88
2,
@@ -14,7 +14,9 @@ class Foo {
1414
constructor(){
1515
_initProto(this);
1616
}
17-
#x = _call_x;
17+
get #x() {
18+
return _call_x;
19+
}
1820
bar() {
1921
[...this.#x] = this.baz;
2022
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method-via-update/output.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _call_x, _initProto;
22
const dec = ()=>{};
33
class Foo {
44
static{
5-
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
5+
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
66
[
77
dec,
88
2,
@@ -14,7 +14,9 @@ class Foo {
1414
constructor(){
1515
_initProto(this);
1616
}
17-
#x = _call_x;
17+
get #x() {
18+
return _call_x;
19+
}
1820
bar() {
1921
this.#x++;
2022
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/setting-private-method/output.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _call_x, _initProto;
22
const dec = ()=>{};
33
class Foo {
44
static{
5-
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
5+
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
66
[
77
dec,
88
2,
@@ -14,7 +14,9 @@ class Foo {
1414
constructor(){
1515
_initProto(this);
1616
}
17-
#x = _call_x;
17+
get #x() {
18+
return _call_x;
19+
}
1820
bar() {
1921
this.#x = 123;
2022
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-misc/super-in-private-method/output.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _call_x, _initProto;
22
const dec = ()=>{};
33
class Foo extends Bar {
44
static{
5-
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
5+
({ e: [_call_x, _initProto] } = _apply_decs_2203_r(this, [
66
[
77
dec,
88
2,
@@ -17,5 +17,7 @@ class Foo extends Bar {
1717
super(...args);
1818
_initProto(this);
1919
}
20-
#x = _call_x;
20+
get #x() {
21+
return _call_x;
22+
}
2123
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/accessor-simple/1/output.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _initClass, _init_b, _init_c, _get___c, _set___c, _call_d, _initProto, _init
22
let _A;
33
class A {
44
static{
5-
({ e: [_init_b, _init_c, _get___c, _set___c, _call_d, _initProto, _initStatic] , c: [_A, _initClass] } = _apply_decs_2203_r(this, [
5+
({ e: [_init_b, _init_c, _get___c, _set___c, _call_d, _initProto, _initStatic], c: [_A, _initClass] } = _apply_decs_2203_r(this, [
66
[
77
dec3,
88
6,
@@ -53,7 +53,9 @@ class A {
5353
static set #c(_v) {
5454
_set___c(this, _v);
5555
}
56-
#d = _call_d;
56+
get #d() {
57+
return _call_d;
58+
}
5759
static{
5860
_initClass();
5961
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/accessor-static-method-initializers/output.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ new class extends _identity {
1010
static{
1111
class A {
1212
static{
13-
({ e: [_call_c, _init_a, _init_d, _get___d, _set___d, _initProto, _initStatic] , c: [_A, _initClass] } = _apply_decs_2203_r(this, [
13+
({ e: [_call_c, _init_a, _init_d, _get___d, _set___d, _initProto, _initStatic], c: [_A, _initClass] } = _apply_decs_2203_r(this, [
1414
[
1515
[
1616
_dec4,
@@ -76,5 +76,7 @@ new class extends _identity {
7676
}
7777
}
7878
}
79-
#c = _call_c;
79+
get #c() {
80+
return _call_c;
81+
}
8082
}();

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-ordering/initializers/output.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ new class extends _identity {
88
static{
99
class A {
1010
static{
11-
({ e: [_call_c, _init_f, _init_g, _get___g, _set___g, _call_d, _init_e, _init_h, _get___h, _set___h, _initProto, _initStatic] , c: [_A, _initClass] } = _apply_decs_2203_r(this, [
11+
({ e: [_call_c, _init_f, _init_g, _get___g, _set___g, _call_d, _init_e, _init_h, _get___h, _set___h, _initProto, _initStatic], c: [_A, _initClass] } = _apply_decs_2203_r(this, [
1212
[
1313
[
1414
_dec4,
@@ -95,7 +95,9 @@ new class extends _identity {
9595
}
9696
a() {}
9797
static b() {}
98-
#d = _call_d;
98+
get #d() {
99+
return _call_d;
100+
}
99101
#___private_e = (_initProto(this), _init_e(this));
100102
get e() {
101103
return this.#___private_e;
@@ -118,7 +120,9 @@ new class extends _identity {
118120
}
119121
}
120122
}
121-
#c = _call_c;
123+
get #c() {
124+
return _call_c;
125+
}
122126
#___private_f = _init_f(this);
123127
#__g = _init_g(this);
124128
get #g() {

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters--to-es2015/private/output.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ var __ = {
2828
], [])
2929
};
3030
function set_a(v) {
31-
_call_a(this, v);
31+
return _call_a(this, v);
3232
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters--to-es2015/static-private/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var _a = {
1212
var __ = {
1313
writable: true,
1414
value: (()=>{
15-
({ e: [_call_a, _initStatic] } = _apply_decs_2203_r(Foo, [
15+
({ e: [_call_a, _initStatic] } = _apply_decs_2203_r(Foo, [
1616
[
1717
dec,
1818
9,
@@ -27,5 +27,5 @@ var __ = {
2727
};
2828
_define_property(Foo, "value", 1);
2929
function set_a(v) {
30-
_call_a(this, v);
30+
return _call_a(this, v);
3131
}

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters/private/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _call_a, _initProto;
22
const dec = ()=>{};
33
class Foo {
44
static{
5-
({ e: [_call_a, _initProto] } = _apply_decs_2203_r(this, [
5+
({ e: [_call_a, _initProto] } = _apply_decs_2203_r(this, [
66
[
77
dec,
88
4,
@@ -18,7 +18,7 @@ class Foo {
1818
}
1919
value = 1;
2020
set #a(v) {
21-
_call_a(this, v);
21+
return _call_a(this, v);
2222
}
2323
setA(v) {
2424
this.#a = v;

‎crates/swc_ecma_transforms_proposal/tests/decorators/2022-03-setters/static-private/output.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _call_a, _initStatic;
22
const dec = ()=>{};
33
class Foo {
44
static{
5-
({ e: [_call_a, _initStatic] } = _apply_decs_2203_r(this, [
5+
({ e: [_call_a, _initStatic] } = _apply_decs_2203_r(this, [
66
[
77
dec,
88
9,
@@ -16,7 +16,7 @@ class Foo {
1616
}
1717
static value = 1;
1818
static set #a(v) {
19-
_call_a(this, v);
19+
return _call_a(this, v);
2020
}
2121
static setA(v) {
2222
this.#a = v;

1 commit comments

Comments
 (1)

github-actions[bot] commented on Sep 28, 2023

@github-actions[bot]

Benchmark

Benchmark suite Current: 38bc710 Previous: 5817268 Ratio
es/full/bugs-1 292835 ns/iter (± 10082) 284593 ns/iter (± 4996) 1.03
es/full/minify/libraries/antd 1315995624 ns/iter (± 18473083) 1338196435 ns/iter (± 15375926) 0.98
es/full/minify/libraries/d3 277406238 ns/iter (± 3393749) 273285161 ns/iter (± 3932503) 1.02
es/full/minify/libraries/echarts 1062448946 ns/iter (± 20500512) 1061781553 ns/iter (± 6140023) 1.00
es/full/minify/libraries/jquery 83558813 ns/iter (± 176392) 83670064 ns/iter (± 348666) 1.00
es/full/minify/libraries/lodash 97253814 ns/iter (± 248356) 96999967 ns/iter (± 286219) 1.00
es/full/minify/libraries/moment 49495554 ns/iter (± 104500) 49428648 ns/iter (± 103449) 1.00
es/full/minify/libraries/react 17900940 ns/iter (± 62713) 17862869 ns/iter (± 65568) 1.00
es/full/minify/libraries/terser 217602082 ns/iter (± 458473) 216595625 ns/iter (± 897632) 1.00
es/full/minify/libraries/three 385690773 ns/iter (± 2303723) 388864484 ns/iter (± 2240336) 0.99
es/full/minify/libraries/typescript 2655033055 ns/iter (± 12817397) 2714244243 ns/iter (± 31156729) 0.98
es/full/minify/libraries/victory 564255625 ns/iter (± 3079118) 578801457 ns/iter (± 5121085) 0.97
es/full/minify/libraries/vue 119122326 ns/iter (± 383014) 119346698 ns/iter (± 372556) 1.00
es/full/codegen/es3 34990 ns/iter (± 120) 35560 ns/iter (± 597) 0.98
es/full/codegen/es5 34846 ns/iter (± 143) 35802 ns/iter (± 422) 0.97
es/full/codegen/es2015 34862 ns/iter (± 92) 35728 ns/iter (± 113) 0.98
es/full/codegen/es2016 34817 ns/iter (± 122) 35693 ns/iter (± 137) 0.98
es/full/codegen/es2017 34859 ns/iter (± 97) 35694 ns/iter (± 203) 0.98
es/full/codegen/es2018 34799 ns/iter (± 107) 35705 ns/iter (± 115) 0.97
es/full/codegen/es2019 34949 ns/iter (± 104) 35722 ns/iter (± 205) 0.98
es/full/codegen/es2020 34857 ns/iter (± 163) 35682 ns/iter (± 127) 0.98
es/full/all/es3 164104993 ns/iter (± 931894) 165089211 ns/iter (± 1474649) 0.99
es/full/all/es5 157456785 ns/iter (± 1625657) 157001871 ns/iter (± 900164) 1.00
es/full/all/es2015 117387903 ns/iter (± 1102040) 116301140 ns/iter (± 582343) 1.01
es/full/all/es2016 115623727 ns/iter (± 1550286) 115777511 ns/iter (± 475661) 1.00
es/full/all/es2017 114660643 ns/iter (± 1107395) 115136476 ns/iter (± 608547) 1.00
es/full/all/es2018 113788337 ns/iter (± 787702) 113503622 ns/iter (± 685860) 1.00
es/full/all/es2019 112911948 ns/iter (± 623637) 111837033 ns/iter (± 922310) 1.01
es/full/all/es2020 107690003 ns/iter (± 799645) 108476122 ns/iter (± 528342) 0.99
es/full/parser 491421 ns/iter (± 5446) 487206 ns/iter (± 5325) 1.01
es/full/base/fixer 20901 ns/iter (± 156) 17668 ns/iter (± 65) 1.18
es/full/base/resolver_and_hygiene 82757 ns/iter (± 835) 81056 ns/iter (± 197) 1.02
serialization of serde 292 ns/iter (± 0) 299 ns/iter (± 6) 0.98
css/minify/libraries/bootstrap 29100192 ns/iter (± 51642) 28626959 ns/iter (± 54720) 1.02
css/visitor/compare/clone 1653686 ns/iter (± 13382) 1676891 ns/iter (± 6166) 0.99
css/visitor/compare/visit_mut_span 1776330 ns/iter (± 5688) 1808256 ns/iter (± 12351) 0.98
css/visitor/compare/visit_mut_span_panic 1841336 ns/iter (± 3087) 1891666 ns/iter (± 8518) 0.97
css/visitor/compare/fold_span 2581196 ns/iter (± 4931) 2593686 ns/iter (± 11559) 1.00
css/visitor/compare/fold_span_panic 2785907 ns/iter (± 11518) 2765662 ns/iter (± 10810) 1.01
css/lexer/bootstrap_5_1_3 4483800 ns/iter (± 7895) 4436016 ns/iter (± 3393) 1.01
css/lexer/foundation_6_7_4 3733794 ns/iter (± 10694) 3722066 ns/iter (± 4353) 1.00
css/lexer/tailwind_3_1_1 708523 ns/iter (± 1849) 707369 ns/iter (± 1260) 1.00
css/parser/bootstrap_5_1_3 19686475 ns/iter (± 35403) 20021603 ns/iter (± 76482) 0.98
css/parser/foundation_6_7_4 15803629 ns/iter (± 22217) 15956825 ns/iter (± 24219) 0.99
css/parser/tailwind_3_1_1 3007980 ns/iter (± 2756) 3047750 ns/iter (± 2176) 0.99
es/codegen/colors 738013 ns/iter (± 403277) 745254 ns/iter (± 405718) 0.99
es/codegen/large 3153538 ns/iter (± 1682367) 2885270 ns/iter (± 1519264) 1.09
es/codegen/with-parser/colors 45889 ns/iter (± 292) 46270 ns/iter (± 315) 0.99
es/codegen/with-parser/large 493632 ns/iter (± 728) 493887 ns/iter (± 1350) 1.00
es/minify/libraries/antd 1127096429 ns/iter (± 14796159) 1194928517 ns/iter (± 9130868) 0.94
es/minify/libraries/d3 238395514 ns/iter (± 1057147) 239955393 ns/iter (± 732659) 0.99
es/minify/libraries/echarts 902028020 ns/iter (± 7719329) 931644924 ns/iter (± 8100766) 0.97
es/minify/libraries/jquery 72735647 ns/iter (± 146273) 73311822 ns/iter (± 98934) 0.99
es/minify/libraries/lodash 86700647 ns/iter (± 147885) 86884660 ns/iter (± 269888) 1.00
es/minify/libraries/moment 43148038 ns/iter (± 137398) 43579872 ns/iter (± 78319) 0.99
es/minify/libraries/react 15921644 ns/iter (± 43882) 16047549 ns/iter (± 39462) 0.99
es/minify/libraries/terser 184797150 ns/iter (± 1041819) 187350148 ns/iter (± 673700) 0.99
es/minify/libraries/three 319705400 ns/iter (± 1413069) 324443452 ns/iter (± 1333672) 0.99
es/minify/libraries/typescript 2235946281 ns/iter (± 10811418) 2332854828 ns/iter (± 15934029) 0.96
es/minify/libraries/victory 471230031 ns/iter (± 2508820) 477798223 ns/iter (± 12903764) 0.99
es/minify/libraries/vue 105852882 ns/iter (± 499387) 106322230 ns/iter (± 538141) 1.00
es/visitor/compare/clone 1926409 ns/iter (± 2539) 1946679 ns/iter (± 7511) 0.99
es/visitor/compare/visit_mut_span 2268965 ns/iter (± 8120) 2280199 ns/iter (± 5837) 1.00
es/visitor/compare/visit_mut_span_panic 2308680 ns/iter (± 9130) 2325427 ns/iter (± 4278) 0.99
es/visitor/compare/fold_span 3369069 ns/iter (± 6949) 3404458 ns/iter (± 11481) 0.99
es/visitor/compare/fold_span_panic 3499131 ns/iter (± 86460) 3521894 ns/iter (± 8581) 0.99
es/lexer/colors 13076 ns/iter (± 81) 13416 ns/iter (± 17) 0.97
es/lexer/angular 6133242 ns/iter (± 15912) 6113881 ns/iter (± 3835) 1.00
es/lexer/backbone 799803 ns/iter (± 1513) 788810 ns/iter (± 1441) 1.01
es/lexer/jquery 4505032 ns/iter (± 5057) 4462639 ns/iter (± 17302) 1.01
es/lexer/jquery mobile 7009813 ns/iter (± 44472) 6870837 ns/iter (± 4721) 1.02
es/lexer/mootools 3578978 ns/iter (± 18672) 3550969 ns/iter (± 3559) 1.01
es/lexer/underscore 675818 ns/iter (± 3880) 658075 ns/iter (± 232) 1.03
es/lexer/three 21474930 ns/iter (± 28892) 21325653 ns/iter (± 10253) 1.01
es/lexer/yui 3849243 ns/iter (± 4608) 3810915 ns/iter (± 4849) 1.01
es/parser/colors 27594 ns/iter (± 59) 27407 ns/iter (± 70) 1.01
es/parser/angular 13460736 ns/iter (± 51416) 13715464 ns/iter (± 59055) 0.98
es/parser/backbone 1975922 ns/iter (± 9268) 2007394 ns/iter (± 6065) 0.98
es/parser/jquery 10778757 ns/iter (± 47808) 10980688 ns/iter (± 33890) 0.98
es/parser/jquery mobile 16497780 ns/iter (± 44531) 16834117 ns/iter (± 82369) 0.98
es/parser/mootools 8315216 ns/iter (± 17873) 8418806 ns/iter (± 22672) 0.99
es/parser/underscore 1693482 ns/iter (± 10383) 1728808 ns/iter (± 11205) 0.98
es/parser/three 46328445 ns/iter (± 144509) 47295480 ns/iter (± 148701) 0.98
es/parser/yui 8265364 ns/iter (± 26062) 8346771 ns/iter (± 24164) 0.99
es/preset-env/usage/builtin_type 134662 ns/iter (± 31536) 136566 ns/iter (± 31621) 0.99
es/preset-env/usage/property 16106 ns/iter (± 47) 16656 ns/iter (± 56) 0.97
es/resolver/typescript 90659864 ns/iter (± 1050734) 92252677 ns/iter (± 1498571) 0.98
es/fixer/typescript 63762441 ns/iter (± 260394) 64672963 ns/iter (± 614213) 0.99
es/hygiene/typescript 127984463 ns/iter (± 389366) 131854904 ns/iter (± 598336) 0.97
es/resolver_with_hygiene/typescript 243106672 ns/iter (± 1645986) 248059133 ns/iter (± 1590101) 0.98
es/visitor/base-perf/module_clone 59101 ns/iter (± 271) 59087 ns/iter (± 584) 1.00
es/visitor/base-perf/fold_empty 62983 ns/iter (± 345) 62587 ns/iter (± 158) 1.01
es/visitor/base-perf/fold_noop_impl_all 63843 ns/iter (± 435) 63080 ns/iter (± 573) 1.01
es/visitor/base-perf/fold_noop_impl_vec 64048 ns/iter (± 225) 63130 ns/iter (± 205) 1.01
es/visitor/base-perf/boxing_boxed_clone 58 ns/iter (± 0) 56 ns/iter (± 0) 1.04
es/visitor/base-perf/boxing_unboxed_clone 41 ns/iter (± 0) 39 ns/iter (± 0) 1.05
es/visitor/base-perf/boxing_boxed 110 ns/iter (± 0) 108 ns/iter (± 0) 1.02
es/visitor/base-perf/boxing_unboxed 78 ns/iter (± 0) 77 ns/iter (± 0) 1.01
es/visitor/base-perf/visit_empty 0 ns/iter (± 0) 0 ns/iter (± 0) NaN
es/visitor/base-perf/visit_contains_this 2484 ns/iter (± 11) 2522 ns/iter (± 12) 0.98
es/base/parallel/resolver/typescript 3684072591 ns/iter (± 270947608) 4754632007 ns/iter (± 249426718) 0.77
es/base/parallel/hygiene/typescript 1426606180 ns/iter (± 16524256) 1443650950 ns/iter (± 20362924) 0.99
misc/visitors/time-complexity/time 5 135 ns/iter (± 1) 124 ns/iter (± 1) 1.09
misc/visitors/time-complexity/time 10 388 ns/iter (± 10) 399 ns/iter (± 5) 0.97
misc/visitors/time-complexity/time 15 679 ns/iter (± 5) 680 ns/iter (± 20) 1.00
misc/visitors/time-complexity/time 20 1068 ns/iter (± 52) 1056 ns/iter (± 6) 1.01
misc/visitors/time-complexity/time 40 3517 ns/iter (± 24) 3657 ns/iter (± 42) 0.96
misc/visitors/time-complexity/time 60 7354 ns/iter (± 616) 7559 ns/iter (± 423) 0.97

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.