-
-
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/ts_strip): Handle ASI hazard in return statement (#9882)
**Related issue:** - Closes #9878
- Loading branch information
1 parent
92fd3d2
commit 121b5fe
Showing
5 changed files
with
101 additions
and
9 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: minor | ||
--- | ||
|
||
fix(es/ts_strip): Handle ASI hazard in return statement |
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,18 @@ | ||
function f() { | ||
return ( | ||
x )=>x; | ||
} | ||
|
||
function f2() { | ||
return ( | ||
|
||
x )=>x; | ||
} | ||
|
||
|
||
function f3() { | ||
return ( | ||
|
||
x | ||
)=>x; | ||
} |
9 changes: 9 additions & 0 deletions
9
crates/swc_fast_ts_strip/tests/fixture/issue-9878.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,9 @@ | ||
function f() { | ||
return (x)=>x; | ||
} | ||
function f2() { | ||
return (x)=>x; | ||
} | ||
function f3() { | ||
return (x)=>x; | ||
} |
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,18 @@ | ||
function f() { | ||
return <T> | ||
(x: T)=>x; | ||
} | ||
|
||
function f2() { | ||
return <T | ||
> | ||
(x: T)=>x; | ||
} | ||
|
||
|
||
function f3() { | ||
return <T | ||
> | ||
(x: T): Promise< | ||
T>=>x; | ||
} |