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): Implement loose mode for
class_properties
(#3722)
- Loading branch information
Showing
40 changed files
with
1,388 additions
and
642 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
17 changes: 6 additions & 11 deletions
17
crates/swc/tests/fixture/issue-2011/reduced/output/index.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,16 +1,11 @@ | ||
var a = function() {}; | ||
module.exports = (function() { | ||
var b, c, d, e = function() { | ||
var b = function() { | ||
"use strict"; | ||
function e() {} | ||
return e.prototype.it = function() { | ||
this.bb = new e.MyA(); | ||
}, e; | ||
function b() {} | ||
return b.prototype.it = function() { | ||
this.bb = new b.MyA(); | ||
}, b; | ||
}(); | ||
return b = e, c = "MyA", d = a, c in b ? Object.defineProperty(b, c, { | ||
value: d, | ||
enumerable: !0, | ||
configurable: !0, | ||
writable: !0 | ||
}) : b[c] = d, e; | ||
return b.MyA = a, b; | ||
})(); |
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
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
6 changes: 5 additions & 1 deletion
6
crates/swc_ecma_preset_env/tests/fixtures/corejs3/usage-false-positive/output.mjs
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 +1,5 @@ | ||
[1, 2, 3][flatMap]; | ||
[ | ||
1, | ||
2, | ||
3 | ||
][flatMap]; |
5 changes: 3 additions & 2 deletions
5
crates/swc_ecma_preset_env/tests/fixtures/transform/static-block/output.mjs
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,8 +1,9 @@ | ||
var __ = _classPrivateFieldLooseKey("__"); | ||
class A { | ||
} | ||
var __ = { | ||
Object.defineProperty(A, __, { | ||
writable: true, | ||
value: (()=>{ | ||
A.abc = 123; | ||
})() | ||
}; | ||
}); |
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.
14155eb
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
full_es2015
161630320
ns/iter (± 31582901
)218390906
ns/iter (± 22835954
)0.74
full_es2016
178726641
ns/iter (± 19231431
)225927439
ns/iter (± 19268688
)0.79
full_es2017
178834214
ns/iter (± 40347115
)226197335
ns/iter (± 18194498
)0.79
full_es2018
176653869
ns/iter (± 22181386
)226739859
ns/iter (± 17648367
)0.78
full_es2019
178140924
ns/iter (± 31564308
)229200980
ns/iter (± 29608015
)0.78
full_es2020
160296432
ns/iter (± 16471539
)197670899
ns/iter (± 33786199
)0.81
full_es3
219455448
ns/iter (± 15704702
)289749546
ns/iter (± 22671119
)0.76
full_es5
225429420
ns/iter (± 23526362
)287814546
ns/iter (± 19535184
)0.78
parser
678361
ns/iter (± 17909
)903496
ns/iter (± 111197
)0.75
This comment was automatically generated by workflow using github-action-benchmark.