-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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: Huáng Jùnliàng <jlhwung@gmail.com> Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
- Loading branch information
1 parent
6e3dffe
commit 8067a84
Showing
27 changed files
with
159 additions
and
123 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
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
6 changes: 3 additions & 3 deletions
6
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,5 @@ | ||
// Not type-correct code | ||
var E; | ||
(function (E) { | ||
var E = /*#__PURE__*/function (E) { | ||
E[E["A"] = true] = "A"; | ||
})(E || (E = {})); | ||
return E; | ||
}(E || {}); |
5 changes: 3 additions & 2 deletions
5
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,4 @@ | ||
// With --isolatedModules, TSC ignores the "const" modifier when compiling enums | ||
var E; | ||
(function (E) {})(E || (E = {})); | ||
var E = /*#__PURE__*/function (E) { | ||
return 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
11 changes: 6 additions & 5 deletions
11
packages/babel-plugin-transform-typescript/test/fixtures/enum/export/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,8 @@ | ||
export let E; | ||
(function (E) { | ||
export let E = /*#__PURE__*/function (E) { | ||
E[E["A"] = 1] = "A"; | ||
})(E || (E = {})); | ||
(function (E) { | ||
return E; | ||
}({}); | ||
E = /*#__PURE__*/function (E) { | ||
E[E["B"] = 2] = "B"; | ||
})(E || (E = {})); | ||
return E; | ||
}(E || {}); |
6 changes: 3 additions & 3 deletions
6
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,5 @@ | ||
var E; | ||
(function (E) { | ||
var E = /*#__PURE__*/function (E) { | ||
E[E["x"] = 0] = "x"; | ||
E[E["y"] = 1] = "y"; | ||
})(E || (E = {})); | ||
return E; | ||
}(E || {}); |
6 changes: 3 additions & 3 deletions
6
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,5 @@ | ||
var E; | ||
(function (E) { | ||
var E = /*#__PURE__*/function (E) { | ||
E[E["a"] = 10] = "a"; | ||
E[E["b"] = 10] = "b"; | ||
})(E || (E = {})); | ||
return 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
6 changes: 3 additions & 3 deletions
6
...ages/babel-plugin-transform-typescript/test/fixtures/enum/non-foldable-constant/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,5 @@ | ||
var E; | ||
(function (E) { | ||
var E = function (E) { | ||
E[E["a"] = Math.sin(1)] = "a"; | ||
E[E["b"] = 1 + E["a"]] = "b"; | ||
})(E || (E = {})); | ||
return E; | ||
}(E || {}); |
11 changes: 6 additions & 5 deletions
11
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,9 @@ | ||
var E; | ||
(function (E) { | ||
var E = /*#__PURE__*/function (E) { | ||
E[E["x"] = 1] = "x"; | ||
E[E["y"] = 2] = "y"; | ||
})(E || (E = {})); | ||
(function (E) { | ||
return E; | ||
}(E || {}); | ||
E = /*#__PURE__*/function (E) { | ||
E[E["z"] = 3] = "z"; | ||
})(E || (E = {})); | ||
return E; | ||
}(E || {}); |
12 changes: 6 additions & 6 deletions
12
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,14 @@ | ||
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) { | ||
return socketType; | ||
}(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 = {})); | ||
return constants; | ||
}(constants || {}); |
5 changes: 3 additions & 2 deletions
5
packages/babel-plugin-transform-typescript/test/fixtures/enum/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,5 +1,6 @@ | ||
{ | ||
// Uses 'let' within a scope | ||
let E; | ||
(function (E) {})(E || (E = {})); | ||
let E = /*#__PURE__*/function (E) { | ||
return E; | ||
}({}); | ||
} |
6 changes: 3 additions & 3 deletions
6
...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,4 @@ | ||
var E; | ||
(function (E) { | ||
var E = /*#__PURE__*/function (E) { | ||
E["A"] = "Hey"; | ||
})(E || (E = {})); | ||
return E; | ||
}(E || {}); |
6 changes: 3 additions & 3 deletions
6
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,7 @@ | ||
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 = {})); | ||
return E; | ||
}(E || {}); |
6 changes: 3 additions & 3 deletions
6
...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,4 @@ | ||
var E; | ||
(function (E) { | ||
var E = /*#__PURE__*/function (E) { | ||
E["A"] = "HALLOWERLD"; | ||
})(E || (E = {})); | ||
return 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
Oops, something went wrong.