Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[optimizeConstEnums] Inline const enum if only exported as type (#14723)
- Loading branch information
1 parent
f1c4ea3
commit 184eeea
Showing
5 changed files
with
31 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
9 changes: 9 additions & 0 deletions
9
...m-typescript/test/fixtures/optimize-const-enums/export-const-enum-type-and-value/input.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,9 @@ | ||
const enum WhitespaceFlag { | ||
before = 1 << 0, | ||
after = 1 << 1, | ||
} | ||
|
||
export type { WhitespaceFlag as WF1 }; | ||
export { WhitespaceFlag as WF2 }; | ||
|
||
export const before = WhitespaceFlag.before; |
6 changes: 6 additions & 0 deletions
6
...typescript/test/fixtures/optimize-const-enums/export-const-enum-type-and-value/output.mjs
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 @@ | ||
var WhitespaceFlag = { | ||
before: 1, | ||
after: 2 | ||
}; | ||
export { WhitespaceFlag as WF2 }; | ||
export const before = WhitespaceFlag.before; |
9 changes: 9 additions & 0 deletions
9
...rm-typescript/test/fixtures/optimize-const-enums/export-const-enum-type-no-deopt/input.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,9 @@ | ||
const enum WhitespaceFlag { | ||
before = 1 << 0, | ||
after = 1 << 1, | ||
} | ||
|
||
export type { WhitespaceFlag as WF1 }; | ||
export { type WhitespaceFlag as WF2 }; | ||
|
||
export const before = WhitespaceFlag.before; |
2 changes: 2 additions & 0 deletions
2
...-typescript/test/fixtures/optimize-const-enums/export-const-enum-type-no-deopt/output.mjs
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,2 @@ | ||
export {}; | ||
export const before = 1; |