-
-
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.
feat(ts/fast-strip): Support type-only/uninstantiated namespaces (#9983)
**Related issue:** - Closes #9977
- Loading branch information
1 parent
e9843d8
commit a72c6fa
Showing
14 changed files
with
333 additions
and
58 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,6 @@ | ||
--- | ||
swc_core: patch | ||
swc_fast_ts_strip: patch | ||
--- | ||
|
||
feat(ts/fast-strip): Support type-only/uninstantiated namespaces |
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
52 changes: 52 additions & 0 deletions
52
crates/swc_fast_ts_strip/tests/errors/issue-9977.swc-stderr
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,52 @@ | ||
x TypeScript parameter property is not supported in strip-only mode | ||
,-[6:1] | ||
5 | // No parameter properties | ||
6 | constructor(public foo: string) { } | ||
: ^^^^^^^^^^^ | ||
7 | } | ||
`---- | ||
x TypeScript namespace declaration is not supported in strip-only mode | ||
,-[9:1] | ||
8 | | ||
9 | ,-> namespace IllegalBecauseInstantiated { | ||
10 | | export const m = 1; | ||
11 | `-> } | ||
`---- | ||
x TypeScript namespace declaration is not supported in strip-only mode | ||
,-[13:1] | ||
12 | | ||
13 | ,-> namespace AlsoIllegalBecauseInstantiated { | ||
14 | | class PrivateClass { | ||
15 | | | ||
16 | | } | ||
17 | `-> } | ||
`---- | ||
x TypeScript namespace declaration is not supported in strip-only mode | ||
,-[19:1] | ||
18 | | ||
19 | ,-> namespace IllegalBecauseNestedInstantiated { | ||
20 | | namespace Nested { | ||
21 | | export const m = 1; | ||
22 | | } | ||
23 | `-> } | ||
`---- | ||
x TypeScript enum is not supported in strip-only mode | ||
,-[25:1] | ||
24 | | ||
25 | ,-> enum NotLegalEnum { | ||
26 | | B = 1 | ||
27 | `-> } | ||
`---- | ||
x TypeScript import equals declaration is not supported in strip-only mode | ||
,-[29:1] | ||
28 | | ||
29 | import NoGoodAlias = NotLegalEnum.B; | ||
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
`---- | ||
x TypeScript enum is not supported in strip-only mode | ||
,-[31:1] | ||
30 | | ||
31 | ,-> const enum NotLegalConstEnum { | ||
32 | | C = 2 | ||
33 | `-> } | ||
`---- |
Oops, something went wrong.