Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d16c6d6
commit 268f185
Showing
20 changed files
with
116 additions
and
96 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
5 changes: 2 additions & 3 deletions
5
packages/babel-plugin-transform-typescript/test/fixtures/enum/boolean-value/output.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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
// Not type-correct code | ||
var E; | ||
(function (E) { | ||
var E = /*#__PURE__*/function (E) { | ||
E[E["A"] = true] = "A"; | ||
})(E || (E = {})); | ||
}(E || {}); |
3 changes: 1 addition & 2 deletions
3
packages/babel-plugin-transform-typescript/test/fixtures/enum/const/output.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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
// With --isolatedModules, TSC ignores the "const" modifier when compiling enums | ||
var E; | ||
(function (E) {})(E || (E = {})); | ||
var E = /*#__PURE__*/function (E) {}(E || {}); |
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
5 changes: 2 additions & 3 deletions
5
packages/babel-plugin-transform-typescript/test/fixtures/enum/inferred/output.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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
var E; | ||
(function (E) { | ||
var E = /*#__PURE__*/function (E) { | ||
E[E["x"] = 0] = "x"; | ||
E[E["y"] = 1] = "y"; | ||
})(E || (E = {})); | ||
}(E || {}); |
5 changes: 2 additions & 3 deletions
5
packages/babel-plugin-transform-typescript/test/fixtures/enum/inner-references/output.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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
var E; | ||
(function (E) { | ||
var E = /*#__PURE__*/function (E) { | ||
E[E["a"] = 10] = "a"; | ||
E[E["b"] = 10] = "b"; | ||
})(E || (E = {})); | ||
}(E || {}); |
5 changes: 2 additions & 3 deletions
5
packages/babel-plugin-transform-typescript/test/fixtures/enum/mix-references/output.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
9 changes: 4 additions & 5 deletions
9
packages/babel-plugin-transform-typescript/test/fixtures/enum/non-scoped/output.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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
var E; | ||
(function (E) { | ||
var E = /*#__PURE__*/function (E) { | ||
E[E["x"] = 1] = "x"; | ||
E[E["y"] = 2] = "y"; | ||
})(E || (E = {})); | ||
(function (E) { | ||
}(E || {}); | ||
E = /*#__PURE__*/function (E) { | ||
E[E["z"] = 3] = "z"; | ||
})(E || (E = {})); | ||
}(E || {}); |
10 changes: 4 additions & 6 deletions
10
packages/babel-plugin-transform-typescript/test/fixtures/enum/outer-references/output.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 |
---|---|---|
@@ -1,14 +1,12 @@ | ||
var socketType; | ||
(function (socketType) { | ||
var socketType = /*#__PURE__*/function (socketType) { | ||
socketType[socketType["SOCKET"] = 0] = "SOCKET"; | ||
socketType[socketType["SERVER"] = 1] = "SERVER"; | ||
socketType[socketType["IPC"] = 2] = "IPC"; | ||
})(socketType || (socketType = {})); | ||
var constants; | ||
(function (constants) { | ||
}(socketType || {}); | ||
var constants = /*#__PURE__*/function (constants) { | ||
constants[constants["SOCKET"] = 0] = "SOCKET"; | ||
constants[constants["SERVER"] = 1] = "SERVER"; | ||
constants[constants["IPC"] = 2] = "IPC"; | ||
constants[constants["UV_READABLE"] = 3] = "UV_READABLE"; | ||
constants[constants["UV_WRITABLE"] = 4] = "UV_WRITABLE"; | ||
})(constants || (constants = {})); | ||
}(constants || {}); |
5 changes: 2 additions & 3 deletions
5
...ages/babel-plugin-transform-typescript/test/fixtures/enum/string-value-template/output.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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
var E; | ||
(function (E) { | ||
var E = /*#__PURE__*/function (E) { | ||
E["A"] = "Hey"; | ||
})(E || (E = {})); | ||
}(E || {}); |
5 changes: 2 additions & 3 deletions
5
packages/babel-plugin-transform-typescript/test/fixtures/enum/string-value/output.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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
var E; | ||
(function (E) { | ||
var E = /*#__PURE__*/function (E) { | ||
E[E["A"] = 0] = "A"; | ||
E["B"] = ""; | ||
E[E["A2"] = 0] = "A2"; | ||
E["B2"] = ""; | ||
})(E || (E = {})); | ||
}(E || {}); |
5 changes: 2 additions & 3 deletions
5
...ges/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/output.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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
var E; | ||
(function (E) { | ||
var E = /*#__PURE__*/function (E) { | ||
E["A"] = "HALLOWERLD"; | ||
})(E || (E = {})); | ||
}(E || {}); |
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
12 changes: 5 additions & 7 deletions
12
packages/babel-plugin-transform-typescript/test/fixtures/exports/declared-types/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
3 changes: 1 addition & 2 deletions
3
...ges/babel-plugin-transform-typescript/test/fixtures/exports/export-const-enums/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,3 @@ | ||
var None; | ||
(function (None) {})(None || (None = {})); | ||
var None = /*#__PURE__*/function (None) {}(None || {}); | ||
; | ||
export {}; |
5 changes: 2 additions & 3 deletions
5
packages/babel-plugin-transform-typescript/test/fixtures/imports/enum-id/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,6 +1,5 @@ | ||
var Enum; | ||
(function (Enum) { | ||
var Enum = /*#__PURE__*/function (Enum) { | ||
Enum[Enum["A"] = 0] = "A"; | ||
})(Enum || (Enum = {})); | ||
}(Enum || {}); | ||
; | ||
export {}; |
5 changes: 2 additions & 3 deletions
5
packages/babel-plugin-transform-typescript/test/fixtures/imports/enum-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,6 +1,5 @@ | ||
import { A } from 'lib'; | ||
var Enum; | ||
(function (Enum) { | ||
var Enum = /*#__PURE__*/function (Enum) { | ||
Enum[Enum["id"] = A] = "id"; | ||
})(Enum || (Enum = {})); | ||
}(Enum || {}); | ||
; |
5 changes: 2 additions & 3 deletions
5
packages/babel-plugin-transform-typescript/test/fixtures/namespace/clobber-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,7 +1,6 @@ | ||
var A; | ||
(function (A) { | ||
var A = /*#__PURE__*/function (A) { | ||
A[A["C"] = 2] = "C"; | ||
})(A || (A = {})); | ||
}(A || {}); | ||
(function (_A) { | ||
const B = _A.B = 1; | ||
})(A || (A = {})); |
5 changes: 2 additions & 3 deletions
5
packages/babel-preset-typescript/test/fixtures/flow-compat/ts-valid/output.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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
var Example; | ||
(function (Example) { | ||
var Example = /*#__PURE__*/function (Example) { | ||
Example[Example["Value"] = 0] = "Value"; | ||
})(Example || (Example = {})); | ||
}(Example || {}); | ||
foo; |
5 changes: 2 additions & 3 deletions
5
packages/babel-preset-typescript/test/fixtures/flow-compat/tsx-valid/output.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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
var Example; | ||
(function (Example) { | ||
var Example = /*#__PURE__*/function (Example) { | ||
Example[Example["Value"] = 0] = "Value"; | ||
})(Example || (Example = {})); | ||
}(Example || {}); | ||
foo; |