-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/typescript): Fix ASI in expression for fast strip (#9358)
- Closes #9355
- Loading branch information
1 parent
24e8798
commit 3ee82e2
Showing
5 changed files
with
107 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
swc_fast_ts_strip: patch | ||
--- | ||
|
||
fix(es/typescript): Fix ASI in expression for TypeScript strip |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const x1 = 10 ; | ||
(1) | ||
|
||
const x2 = (10); | ||
(1) | ||
|
||
const x3 = 10 ; | ||
(1) | ||
|
||
const x4 = (10); | ||
(1) | ||
|
||
const y = 10 | ||
+ 1 | ||
|
||
const z = 10 | ||
/ 1 | ||
|
||
const w = 10 ; | ||
[1]; |
14 changes: 14 additions & 0 deletions
14
crates/swc_fast_ts_strip/tests/fixture/issue-9355.transform.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,14 @@ | ||
const x1 = 10; | ||
1; | ||
const x2 = 10; | ||
1; | ||
const x3 = 10; | ||
1; | ||
const x4 = 10; | ||
1; | ||
const y = 10 + 1; | ||
const z = 10 / 1; | ||
const w = 10; | ||
[ | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const x1 = 10 as any | ||
(1) | ||
|
||
const x2 = (10)as any | ||
(1) | ||
|
||
const x3 = 10 satisfies any | ||
(1) | ||
|
||
const x4 = (10)satisfies any | ||
(1) | ||
|
||
const y = 10 as any | ||
+ 1 | ||
|
||
const z = 10 as any | ||
/ 1 | ||
|
||
const w = 10 as any | ||
[1]; |