-
-
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/typescrupt): Fix ASI issue in fast ts strip (#9332)
**Related issue:** - Closes #9331
- Loading branch information
1 parent
95af17f
commit 57146cf
Showing
5 changed files
with
176 additions
and
1 deletion.
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/typescrupt): Fix ASI issue in fast ts 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,45 @@ | ||
f | ||
; | ||
(1) | ||
|
||
function f() { } | ||
|
||
|
||
f | ||
; | ||
(1) | ||
|
||
f | ||
; | ||
(1) | ||
|
||
5 | ||
; | ||
-1 | ||
|
||
|
||
f | ||
; | ||
|
||
|
||
[1].map(() => 1) | ||
|
||
f | ||
; | ||
/1/ | ||
|
||
f | ||
; | ||
|
||
/1/ | ||
|
||
|
||
class foo { | ||
static; | ||
|
||
foo() { } | ||
} | ||
|
||
2 | ||
; | ||
+ 3 |
24 changes: 24 additions & 0 deletions
24
crates/swc_fast_ts_strip/tests/fixture/issue-9331.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,24 @@ | ||
f; | ||
1; | ||
function f() {} | ||
f; | ||
1; | ||
f; | ||
1; | ||
5; | ||
-1; | ||
f; | ||
[ | ||
1 | ||
].map(()=>1); | ||
f; | ||
/1/; | ||
f; | ||
/1/; | ||
class foo { | ||
static; | ||
foo() {} | ||
} | ||
2; | ||
+3; | ||
export { }; |
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,45 @@ | ||
f | ||
interface I { } | ||
(1) | ||
|
||
function f() { } | ||
|
||
|
||
f | ||
type x = any; | ||
(1) | ||
|
||
f | ||
import type { x } from 'foo'; | ||
(1) | ||
|
||
5 | ||
interface I { } | ||
-1 | ||
|
||
|
||
f | ||
declare class name { | ||
constructor(); | ||
} | ||
[1].map(() => 1) | ||
|
||
f | ||
declare var x: string; | ||
/1/ | ||
|
||
f | ||
declare var y: string; | ||
declare var z: string; | ||
/1/ | ||
|
||
|
||
class foo { | ||
static: any | ||
declare x: any | ||
foo() { } | ||
} | ||
|
||
2 | ||
export type { } | ||
+ 3 |