-
-
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/compat): Fix legacy decorator pass (#3459)
- Loading branch information
1 parent
ec12019
commit 4f5e87b
Showing
14 changed files
with
43 additions
and
78 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
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
10 changes: 10 additions & 0 deletions
10
crates/swc_ecma_transforms/tests/fixture/decorator/issue-2117/1/exec.ts
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,10 @@ | ||
class TestClass2 { | ||
@deco public testProperty?: string; | ||
} | ||
|
||
function deco(target: any, key: string) { | ||
console.log(target, key); | ||
} | ||
|
||
const instance = new TestClass2(); | ||
expect(instance.hasOwnProperty("testProperty")).toBe(true); |
2 changes: 1 addition & 1 deletion
2
crates/swc_ecma_transforms/tests/fixture/decorator/issue-2127/2/exec.ts
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/tests/fixture/decorator/issue-2127/3/exec.ts
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
4f5e87b
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
212259390
ns/iter (± 11387851
)170250754
ns/iter (± 19716588
)1.25
full_es2016
226035319
ns/iter (± 13486402
)176813931
ns/iter (± 21169408
)1.28
full_es2017
222857563
ns/iter (± 16528123
)177922753
ns/iter (± 19843000
)1.25
full_es2018
220786265
ns/iter (± 18331203
)179045889
ns/iter (± 12518899
)1.23
full_es2019
220337767
ns/iter (± 12725208
)176714601
ns/iter (± 9826885
)1.25
full_es2020
192878309
ns/iter (± 13220187
)157786957
ns/iter (± 22565011
)1.22
full_es3
271883110
ns/iter (± 16672400
)219656153
ns/iter (± 44820389
)1.24
full_es5
277813152
ns/iter (± 14981729
)221269978
ns/iter (± 32053495
)1.26
parser
897632
ns/iter (± 79659
)715559
ns/iter (± 14395
)1.25
This comment was automatically generated by workflow using github-action-benchmark.