-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Babel Bot <30521560+liuxingbaoyu@users.noreply.github.com>
- Loading branch information
1 parent
22725e9
commit dd699a8
Showing
26 changed files
with
134 additions
and
7 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
11 changes: 11 additions & 0 deletions
11
...orm-typescript/test/fixtures/optimize-const-enums/custom-values-exported-babel-7/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,11 @@ | ||
export const enum A { | ||
x = 3, | ||
y = "f", | ||
z = 4 << 2, | ||
w = y | ||
} | ||
|
||
A.x; | ||
A.y; | ||
A.z; | ||
A.w; |
5 changes: 5 additions & 0 deletions
5
...typescript/test/fixtures/optimize-const-enums/custom-values-exported-babel-7/options.json
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 @@ | ||
{ | ||
"plugins": [["transform-typescript", { "optimizeConstEnums": true }]], | ||
"sourceType": "module", | ||
"BABEL_8_BREAKING": false | ||
} |
10 changes: 10 additions & 0 deletions
10
...m-typescript/test/fixtures/optimize-const-enums/custom-values-exported-babel-7/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,10 @@ | ||
export var A = { | ||
x: 3, | ||
y: "f", | ||
z: 16, | ||
w: "f" | ||
}; | ||
A.x; | ||
A.y; | ||
A.z; | ||
A.w; |
5 changes: 5 additions & 0 deletions
5
...ansform-typescript/test/fixtures/optimize-const-enums/custom-values-exported/options.json
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 @@ | ||
{ | ||
"plugins": [["transform-typescript", { "optimizeConstEnums": true }]], | ||
"sourceType": "module", | ||
"BABEL_8_BREAKING": true | ||
} |
2 changes: 1 addition & 1 deletion
2
...transform-typescript/test/fixtures/optimize-const-enums/custom-values-exported/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export var A = { | ||
export const A = { | ||
x: 3, | ||
y: "f", | ||
z: 16, | ||
|
3 changes: 3 additions & 0 deletions
3
...ransform-typescript/test/fixtures/optimize-const-enums/export-const-enum-babel-7/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,3 @@ | ||
export const enum A { y } | ||
|
||
let x = A.y; |
3 changes: 3 additions & 0 deletions
3
...form-typescript/test/fixtures/optimize-const-enums/export-const-enum-babel-7/options.json
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,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": false | ||
} |
4 changes: 4 additions & 0 deletions
4
...nsform-typescript/test/fixtures/optimize-const-enums/export-const-enum-babel-7/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,4 @@ | ||
export var A = { | ||
y: 0 | ||
}; | ||
let x = A.y; |
9 changes: 9 additions & 0 deletions
9
...ript/test/fixtures/optimize-const-enums/export-const-enum-type-and-value-babel-7/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
.../test/fixtures/optimize-const-enums/export-const-enum-type-and-value-babel-7/options.json
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 @@ | ||
{ | ||
"plugins": [["transform-typescript", { "optimizeConstEnums": true }]], | ||
"sourceType": "module", | ||
"validateLogs": true, | ||
"BABEL_8_BREAKING": false | ||
} |
6 changes: 6 additions & 0 deletions
6
...pt/test/fixtures/optimize-const-enums/export-const-enum-type-and-value-babel-7/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; |
3 changes: 2 additions & 1 deletion
3
...pescript/test/fixtures/optimize-const-enums/export-const-enum-type-and-value/options.json
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"plugins": [["transform-typescript", { "optimizeConstEnums": true }]], | ||
"sourceType": "module", | ||
"validateLogs": true | ||
"validateLogs": true, | ||
"BABEL_8_BREAKING": true | ||
} |
2 changes: 1 addition & 1 deletion
2
...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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
var WhitespaceFlag = { | ||
const WhitespaceFlag = { | ||
before: 1, | ||
after: 2 | ||
}; | ||
|
3 changes: 3 additions & 0 deletions
3
...in-transform-typescript/test/fixtures/optimize-const-enums/export-const-enum/options.json
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,3 @@ | ||
{ | ||
"BABEL_8_BREAKING": true | ||
} |
2 changes: 1 addition & 1 deletion
2
...ugin-transform-typescript/test/fixtures/optimize-const-enums/export-const-enum/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export var A = { | ||
export const A = { | ||
y: 0 | ||
}; | ||
let x = A.y; |
5 changes: 5 additions & 0 deletions
5
...-plugin-transform-typescript/test/fixtures/optimize-const-enums/exported-babel-7/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,5 @@ | ||
const enum A { y } | ||
|
||
let x = A.y; | ||
|
||
export { A }; |
6 changes: 6 additions & 0 deletions
6
...gin-transform-typescript/test/fixtures/optimize-const-enums/exported-babel-7/options.json
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 @@ | ||
{ | ||
"plugins": [["transform-typescript", { "optimizeConstEnums": true }]], | ||
"sourceType": "module", | ||
"validateLogs": true, | ||
"BABEL_8_BREAKING": false | ||
} |
5 changes: 5 additions & 0 deletions
5
...lugin-transform-typescript/test/fixtures/optimize-const-enums/exported-babel-7/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,5 @@ | ||
var A = { | ||
y: 0 | ||
}; | ||
let x = A.y; | ||
export { A }; |
6 changes: 6 additions & 0 deletions
6
...abel-plugin-transform-typescript/test/fixtures/optimize-const-enums/exported/options.json
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 @@ | ||
{ | ||
"plugins": [["transform-typescript", { "optimizeConstEnums": true }]], | ||
"sourceType": "module", | ||
"validateLogs": true, | ||
"BABEL_8_BREAKING": true | ||
} |
2 changes: 1 addition & 1 deletion
2
.../babel-plugin-transform-typescript/test/fixtures/optimize-const-enums/exported/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
var A = { | ||
const A = { | ||
y: 0 | ||
}; | ||
let x = A.y; | ||
|
13 changes: 13 additions & 0 deletions
13
...-transform-typescript/test/fixtures/optimize-const-enums/merged-exported-babel-7/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,13 @@ | ||
export const enum A { | ||
x, y | ||
} | ||
|
||
export const enum A { | ||
z | ||
} | ||
|
||
A.x; | ||
A["y"]; | ||
A.z; | ||
A.w; | ||
A; |
6 changes: 6 additions & 0 deletions
6
...nsform-typescript/test/fixtures/optimize-const-enums/merged-exported-babel-7/options.json
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 @@ | ||
{ | ||
"plugins": [["transform-typescript", { "optimizeConstEnums": true }]], | ||
"sourceType": "module", | ||
"validateLogs": true, | ||
"BABEL_8_BREAKING": false | ||
} |
12 changes: 12 additions & 0 deletions
12
...ransform-typescript/test/fixtures/optimize-const-enums/merged-exported-babel-7/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,12 @@ | ||
export var A = { | ||
x: 0, | ||
y: 1 | ||
}; | ||
Object.assign(A, { | ||
z: 0 | ||
}); | ||
A.x; | ||
A["y"]; | ||
A.z; | ||
A.w; | ||
A; |
6 changes: 6 additions & 0 deletions
6
...ugin-transform-typescript/test/fixtures/optimize-const-enums/merged-exported/options.json
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 @@ | ||
{ | ||
"plugins": [["transform-typescript", { "optimizeConstEnums": true }]], | ||
"sourceType": "module", | ||
"validateLogs": true, | ||
"BABEL_8_BREAKING": true | ||
} |
2 changes: 1 addition & 1 deletion
2
...plugin-transform-typescript/test/fixtures/optimize-const-enums/merged-exported/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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export var A = { | ||
export const A = { | ||
x: 0, | ||
y: 1 | ||
}; | ||
|