typescript-to-lua 1.25.1 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CompilerOptions.js +2 -2
- package/dist/LuaAST.js +76 -77
- package/dist/LuaLib.js +12 -12
- package/dist/LuaPrinter.js +2 -2
- package/dist/cli/information.js +2 -2
- package/dist/cli/parse.js +3 -3
- package/dist/cli/report.d.ts +4 -4
- package/dist/cli/report.js +2 -2
- package/dist/cli/tsconfig.js +3 -4
- package/dist/lualib/5.0/Set.lua +58 -0
- package/dist/lualib/5.0/lualib_bundle.lua +58 -0
- package/dist/lualib/5.0/lualib_module_info.json +2 -1
- package/dist/lualib/universal/Set.lua +58 -0
- package/dist/lualib/universal/lualib_bundle.lua +58 -0
- package/dist/lualib/universal/lualib_module_info.json +2 -1
- package/dist/lualib-build/plugin.d.ts +1 -1
- package/dist/lualib-build/util.js +8 -9
- package/dist/measure-performance.js +7 -8
- package/dist/transformation/builtins/array.js +3 -4
- package/dist/transformation/builtins/console.js +1 -2
- package/dist/transformation/builtins/function.js +2 -3
- package/dist/transformation/builtins/global.js +1 -2
- package/dist/transformation/builtins/index.js +4 -5
- package/dist/transformation/builtins/map.js +1 -2
- package/dist/transformation/builtins/math.js +2 -3
- package/dist/transformation/builtins/number.js +3 -4
- package/dist/transformation/builtins/object.js +2 -3
- package/dist/transformation/builtins/promise.js +4 -5
- package/dist/transformation/builtins/string.js +3 -4
- package/dist/transformation/builtins/symbol.js +1 -2
- package/dist/transformation/context/context.d.ts +0 -3
- package/dist/transformation/index.js +2 -3
- package/dist/transformation/pre-transformers/using-transformer.js +1 -2
- package/dist/transformation/utils/annotations.js +5 -5
- package/dist/transformation/utils/assignment-validation.js +1 -2
- package/dist/transformation/utils/export.js +14 -14
- package/dist/transformation/utils/function-context.js +3 -3
- package/dist/transformation/utils/language-extensions.js +10 -10
- package/dist/transformation/utils/lua-ast.js +12 -12
- package/dist/transformation/utils/lualib.js +3 -3
- package/dist/transformation/utils/preceding-statements.js +1 -2
- package/dist/transformation/utils/safe-names.js +3 -3
- package/dist/transformation/utils/scope.js +11 -11
- package/dist/transformation/utils/symbols.js +4 -5
- package/dist/transformation/utils/typescript/index.js +13 -14
- package/dist/transformation/utils/typescript/nodes.js +8 -9
- package/dist/transformation/utils/typescript/types.js +10 -11
- package/dist/transformation/visitors/access.js +4 -4
- package/dist/transformation/visitors/async-await.js +3 -3
- package/dist/transformation/visitors/binary-expression/assignments.js +5 -6
- package/dist/transformation/visitors/binary-expression/bit.js +3 -3
- package/dist/transformation/visitors/binary-expression/compound.js +3 -3
- package/dist/transformation/visitors/binary-expression/destructuring-assignments.js +3 -4
- package/dist/transformation/visitors/binary-expression/index.js +4 -4
- package/dist/transformation/visitors/block.js +3 -3
- package/dist/transformation/visitors/call.js +6 -6
- package/dist/transformation/visitors/class/decorators.js +6 -7
- package/dist/transformation/visitors/class/index.js +14 -3
- package/dist/transformation/visitors/class/members/accessors.js +1 -2
- package/dist/transformation/visitors/class/members/constructor.js +3 -4
- package/dist/transformation/visitors/class/members/fields.js +2 -3
- package/dist/transformation/visitors/class/members/method.js +3 -4
- package/dist/transformation/visitors/class/setup.js +2 -3
- package/dist/transformation/visitors/class/utils.js +5 -6
- package/dist/transformation/visitors/conditional.js +3 -3
- package/dist/transformation/visitors/enum.js +2 -2
- package/dist/transformation/visitors/expression-list.js +4 -5
- package/dist/transformation/visitors/expression-statement.js +2 -2
- package/dist/transformation/visitors/function.js +9 -9
- package/dist/transformation/visitors/identifier.js +4 -4
- package/dist/transformation/visitors/language-extensions/call-extension.js +2 -2
- package/dist/transformation/visitors/language-extensions/identifier.js +2 -3
- package/dist/transformation/visitors/language-extensions/iterable.js +3 -4
- package/dist/transformation/visitors/language-extensions/multi.js +8 -9
- package/dist/transformation/visitors/language-extensions/range.js +3 -4
- package/dist/transformation/visitors/language-extensions/table.js +2 -2
- package/dist/transformation/visitors/language-extensions/vararg.js +2 -3
- package/dist/transformation/visitors/literal.js +3 -3
- package/dist/transformation/visitors/loops/utils.js +4 -5
- package/dist/transformation/visitors/modules/export.js +0 -3
- package/dist/transformation/visitors/modules/import.js +2 -2
- package/dist/transformation/visitors/namespace.js +3 -3
- package/dist/transformation/visitors/optional-chaining.js +6 -7
- package/dist/transformation/visitors/return.js +3 -3
- package/dist/transformation/visitors/spread.js +2 -2
- package/dist/transformation/visitors/typeof.js +2 -2
- package/dist/transformation/visitors/unary-expression.js +2 -2
- package/dist/transformation/visitors/variable-declaration.js +6 -6
- package/dist/transpilation/bundle.js +9 -7
- package/dist/transpilation/find-lua-requires.js +1 -2
- package/dist/transpilation/index.js +5 -6
- package/dist/transpilation/output-collector.js +1 -2
- package/dist/transpilation/plugins.js +1 -2
- package/dist/transpilation/resolve.js +1 -2
- package/dist/transpilation/transformers.js +2 -2
- package/dist/transpilation/transpile.js +1 -2
- package/dist/transpilation/transpiler.js +6 -6
- package/dist/transpilation/utils.js +2 -2
- package/dist/utils.js +9 -9
- package/package.json +6 -7
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformSuperExpression = exports.
|
|
3
|
+
exports.transformSuperExpression = exports.transformThisExpression = exports.transformClassDeclaration = void 0;
|
|
4
|
+
exports.transformClassAsExpression = transformClassAsExpression;
|
|
4
5
|
const ts = require("typescript");
|
|
5
6
|
const lua = require("../../../LuaAST");
|
|
6
7
|
const export_1 = require("../../utils/export");
|
|
@@ -39,7 +40,6 @@ function transformClassAsExpression(expression, context) {
|
|
|
39
40
|
context.addPrecedingStatements(statements);
|
|
40
41
|
return name;
|
|
41
42
|
}
|
|
42
|
-
exports.transformClassAsExpression = transformClassAsExpression;
|
|
43
43
|
function transformClassLikeDeclaration(classDeclaration, context, nameOverride) {
|
|
44
44
|
var _a;
|
|
45
45
|
let className;
|
|
@@ -115,7 +115,7 @@ function transformClassLikeDeclaration(classDeclaration, context, nameOverride)
|
|
|
115
115
|
for (const member of classDeclaration.members) {
|
|
116
116
|
if (ts.isAccessor(member)) {
|
|
117
117
|
// Accessors
|
|
118
|
-
const accessors =
|
|
118
|
+
const accessors = getAllAccessorDeclarations(classDeclaration);
|
|
119
119
|
if (accessors.firstAccessor !== member)
|
|
120
120
|
continue;
|
|
121
121
|
const accessorsResult = (0, accessors_1.transformAccessorDeclarations)(context, accessors, localClassName);
|
|
@@ -161,6 +161,17 @@ function transformClassLikeDeclaration(classDeclaration, context, nameOverride)
|
|
|
161
161
|
context.classSuperInfos.pop();
|
|
162
162
|
return { statements: result, name: className };
|
|
163
163
|
}
|
|
164
|
+
function getAllAccessorDeclarations(classDeclaration) {
|
|
165
|
+
const getAccessor = classDeclaration.members.find(ts.isGetAccessor);
|
|
166
|
+
const setAccessor = classDeclaration.members.find(ts.isSetAccessor);
|
|
167
|
+
// Get the first of the two (that is not undefined)
|
|
168
|
+
const firstAccessor = getAccessor && (!setAccessor || getAccessor.pos < setAccessor.pos) ? getAccessor : setAccessor;
|
|
169
|
+
return {
|
|
170
|
+
firstAccessor,
|
|
171
|
+
setAccessor,
|
|
172
|
+
getAccessor,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
164
175
|
const transformSuperExpression = (expression, context) => {
|
|
165
176
|
const superInfos = context.classSuperInfos;
|
|
166
177
|
const superInfo = superInfos[superInfos.length - 1];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformAccessorDeclarations =
|
|
3
|
+
exports.transformAccessorDeclarations = transformAccessorDeclarations;
|
|
4
4
|
const ts = require("typescript");
|
|
5
5
|
const lua = require("../../../../LuaAST");
|
|
6
6
|
const lua_ast_1 = require("../../../utils/lua-ast");
|
|
@@ -42,5 +42,4 @@ function transformAccessorDeclarations(context, { firstAccessor, getAccessor, se
|
|
|
42
42
|
const call = (0, lualib_1.transformLuaLibFunction)(context, feature, undefined, ...parameters);
|
|
43
43
|
return lua.createExpressionStatement(call);
|
|
44
44
|
}
|
|
45
|
-
exports.transformAccessorDeclarations = transformAccessorDeclarations;
|
|
46
45
|
//# sourceMappingURL=accessors.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createPrototypeName = createPrototypeName;
|
|
4
|
+
exports.createConstructorName = createConstructorName;
|
|
5
|
+
exports.transformConstructorDeclaration = transformConstructorDeclaration;
|
|
4
6
|
const ts = require("typescript");
|
|
5
7
|
const lua = require("../../../../LuaAST");
|
|
6
8
|
const lua_ast_1 = require("../../../utils/lua-ast");
|
|
@@ -11,11 +13,9 @@ const fields_1 = require("./fields");
|
|
|
11
13
|
function createPrototypeName(className) {
|
|
12
14
|
return lua.createTableIndexExpression(lua.cloneIdentifier(className), lua.createStringLiteral("prototype"));
|
|
13
15
|
}
|
|
14
|
-
exports.createPrototypeName = createPrototypeName;
|
|
15
16
|
function createConstructorName(className) {
|
|
16
17
|
return lua.createTableIndexExpression(createPrototypeName(className), lua.createStringLiteral("____constructor"));
|
|
17
18
|
}
|
|
18
|
-
exports.createConstructorName = createConstructorName;
|
|
19
19
|
function transformConstructorDeclaration(context, statement, className, instanceFields, classDeclaration) {
|
|
20
20
|
// Don't transform methods without body (overload declarations)
|
|
21
21
|
if (!statement.body) {
|
|
@@ -61,5 +61,4 @@ function transformConstructorDeclaration(context, statement, className, instance
|
|
|
61
61
|
context.popScope();
|
|
62
62
|
return lua.createAssignmentStatement(createConstructorName(className), lua.createFunctionExpression(block, params, dotsLiteral, lua.NodeFlags.Declaration), constructorWasGenerated ? classDeclaration : statement);
|
|
63
63
|
}
|
|
64
|
-
exports.transformConstructorDeclaration = transformConstructorDeclaration;
|
|
65
64
|
//# sourceMappingURL=constructor.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.transformClassInstanceFields = transformClassInstanceFields;
|
|
4
|
+
exports.transformStaticPropertyDeclaration = transformStaticPropertyDeclaration;
|
|
4
5
|
const lua = require("../../../../LuaAST");
|
|
5
6
|
const lua_ast_1 = require("../../../utils/lua-ast");
|
|
6
7
|
const preceding_statements_1 = require("../../../utils/preceding-statements");
|
|
@@ -22,7 +23,6 @@ function transformClassInstanceFields(context, instanceFields) {
|
|
|
22
23
|
}
|
|
23
24
|
return statements;
|
|
24
25
|
}
|
|
25
|
-
exports.transformClassInstanceFields = transformClassInstanceFields;
|
|
26
26
|
function transformStaticPropertyDeclaration(context, field, className) {
|
|
27
27
|
if (!field.initializer)
|
|
28
28
|
return;
|
|
@@ -31,5 +31,4 @@ function transformStaticPropertyDeclaration(context, field, className) {
|
|
|
31
31
|
const classField = lua.createTableIndexExpression(lua.cloneIdentifier(className), fieldName);
|
|
32
32
|
return lua.createAssignmentStatement(classField, value);
|
|
33
33
|
}
|
|
34
|
-
exports.transformStaticPropertyDeclaration = transformStaticPropertyDeclaration;
|
|
35
34
|
//# sourceMappingURL=fields.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.transformMemberExpressionOwnerName = transformMemberExpressionOwnerName;
|
|
4
|
+
exports.transformMethodName = transformMethodName;
|
|
5
|
+
exports.transformMethodDeclaration = transformMethodDeclaration;
|
|
4
6
|
const ts = require("typescript");
|
|
5
7
|
const lua = require("../../../../LuaAST");
|
|
6
8
|
const function_1 = require("../../function");
|
|
@@ -11,7 +13,6 @@ const decorators_1 = require("../decorators");
|
|
|
11
13
|
function transformMemberExpressionOwnerName(node, className) {
|
|
12
14
|
return (0, utils_1.isStaticNode)(node) ? lua.cloneIdentifier(className) : (0, constructor_1.createPrototypeName)(className);
|
|
13
15
|
}
|
|
14
|
-
exports.transformMemberExpressionOwnerName = transformMemberExpressionOwnerName;
|
|
15
16
|
function transformMethodName(context, node) {
|
|
16
17
|
const methodName = (0, literal_1.transformPropertyName)(context, node.name);
|
|
17
18
|
if (lua.isStringLiteral(methodName) && methodName.value === "toString") {
|
|
@@ -19,7 +20,6 @@ function transformMethodName(context, node) {
|
|
|
19
20
|
}
|
|
20
21
|
return methodName;
|
|
21
22
|
}
|
|
22
|
-
exports.transformMethodName = transformMethodName;
|
|
23
23
|
function transformMethodDeclaration(context, node, className) {
|
|
24
24
|
var _a, _b;
|
|
25
25
|
// Don't transform methods without body (overload declarations)
|
|
@@ -50,5 +50,4 @@ function transformMethodDeclaration(context, node, className) {
|
|
|
50
50
|
];
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
exports.transformMethodDeclaration = transformMethodDeclaration;
|
|
54
53
|
//# sourceMappingURL=method.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createClassSetup = createClassSetup;
|
|
4
|
+
exports.getReflectionClassName = getReflectionClassName;
|
|
4
5
|
const ts = require("typescript");
|
|
5
6
|
const lua = require("../../../LuaAST");
|
|
6
7
|
const utils_1 = require("../../../utils");
|
|
@@ -42,7 +43,6 @@ function createClassSetup(context, statement, className, localClassName, extends
|
|
|
42
43
|
}
|
|
43
44
|
return result;
|
|
44
45
|
}
|
|
45
|
-
exports.createClassSetup = createClassSetup;
|
|
46
46
|
function getReflectionClassName(declaration, className) {
|
|
47
47
|
if (declaration.name) {
|
|
48
48
|
return lua.createStringLiteral(declaration.name.text);
|
|
@@ -58,5 +58,4 @@ function getReflectionClassName(declaration, className) {
|
|
|
58
58
|
}
|
|
59
59
|
return lua.createStringLiteral("");
|
|
60
60
|
}
|
|
61
|
-
exports.getReflectionClassName = getReflectionClassName;
|
|
62
61
|
//# sourceMappingURL=setup.js.map
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isPrivateNode = isPrivateNode;
|
|
4
|
+
exports.isStaticNode = isStaticNode;
|
|
5
|
+
exports.getExtendsClause = getExtendsClause;
|
|
6
|
+
exports.getExtendedNode = getExtendedNode;
|
|
7
|
+
exports.getExtendedType = getExtendedType;
|
|
4
8
|
const ts = require("typescript");
|
|
5
9
|
function isPrivateNode(node) {
|
|
6
10
|
var _a;
|
|
7
11
|
return ((_a = node.modifiers) === null || _a === void 0 ? void 0 : _a.some(m => m.kind === ts.SyntaxKind.PrivateKeyword)) === true;
|
|
8
12
|
}
|
|
9
|
-
exports.isPrivateNode = isPrivateNode;
|
|
10
13
|
function isStaticNode(node) {
|
|
11
14
|
var _a;
|
|
12
15
|
return ((_a = node.modifiers) === null || _a === void 0 ? void 0 : _a.some(m => m.kind === ts.SyntaxKind.StaticKeyword)) === true;
|
|
13
16
|
}
|
|
14
|
-
exports.isStaticNode = isStaticNode;
|
|
15
17
|
function getExtendsClause(node) {
|
|
16
18
|
var _a;
|
|
17
19
|
return (_a = node.heritageClauses) === null || _a === void 0 ? void 0 : _a.find(clause => clause.token === ts.SyntaxKind.ExtendsKeyword);
|
|
18
20
|
}
|
|
19
|
-
exports.getExtendsClause = getExtendsClause;
|
|
20
21
|
function getExtendedNode(node) {
|
|
21
22
|
const extendsClause = getExtendsClause(node);
|
|
22
23
|
if (!extendsClause)
|
|
23
24
|
return;
|
|
24
25
|
return extendsClause.types[0];
|
|
25
26
|
}
|
|
26
|
-
exports.getExtendedNode = getExtendedNode;
|
|
27
27
|
function getExtendedType(context, node) {
|
|
28
28
|
const extendedNode = getExtendedNode(node);
|
|
29
29
|
return extendedNode && context.checker.getTypeAtLocation(extendedNode);
|
|
30
30
|
}
|
|
31
|
-
exports.getExtendedType = getExtendedType;
|
|
32
31
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.transformConditionalExpression = void 0;
|
|
4
|
+
exports.transformIfStatement = transformIfStatement;
|
|
5
|
+
exports.checkOnlyTruthyCondition = checkOnlyTruthyCondition;
|
|
4
6
|
const ts = require("typescript");
|
|
5
7
|
const lua = require("../../LuaAST");
|
|
6
8
|
const preceding_statements_1 = require("../utils/preceding-statements");
|
|
@@ -74,7 +76,6 @@ function transformIfStatement(statement, context) {
|
|
|
74
76
|
}
|
|
75
77
|
return lua.createIfStatement(condition, ifBlock);
|
|
76
78
|
}
|
|
77
|
-
exports.transformIfStatement = transformIfStatement;
|
|
78
79
|
function checkOnlyTruthyCondition(condition, context) {
|
|
79
80
|
if (context.options.strictNullChecks === false)
|
|
80
81
|
return; // This check is not valid if everything could implicitly be nil
|
|
@@ -84,5 +85,4 @@ function checkOnlyTruthyCondition(condition, context) {
|
|
|
84
85
|
context.diagnostics.push((0, diagnostics_1.truthyOnlyConditionalValue)(condition));
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
|
-
exports.checkOnlyTruthyCondition = checkOnlyTruthyCondition;
|
|
88
88
|
//# sourceMappingURL=conditional.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformEnumDeclaration =
|
|
3
|
+
exports.transformEnumDeclaration = void 0;
|
|
4
|
+
exports.tryGetConstEnumValue = tryGetConstEnumValue;
|
|
4
5
|
const ts = require("typescript");
|
|
5
6
|
const lua = require("../../LuaAST");
|
|
6
7
|
const annotations_1 = require("../utils/annotations");
|
|
@@ -18,7 +19,6 @@ function tryGetConstEnumValue(context, node) {
|
|
|
18
19
|
return lua.createNumericLiteral(value, node);
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
|
-
exports.tryGetConstEnumValue = tryGetConstEnumValue;
|
|
22
22
|
const transformEnumDeclaration = (node, context) => {
|
|
23
23
|
if (ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Const && !context.options.preserveConstEnums) {
|
|
24
24
|
return undefined;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.shouldMoveToTemp = shouldMoveToTemp;
|
|
4
|
+
exports.moveToPrecedingTemp = moveToPrecedingTemp;
|
|
5
|
+
exports.transformExpressionList = transformExpressionList;
|
|
6
|
+
exports.transformOrderedExpressions = transformOrderedExpressions;
|
|
4
7
|
const assert = require("assert");
|
|
5
8
|
const ts = require("typescript");
|
|
6
9
|
const lua = require("../../LuaAST");
|
|
@@ -17,7 +20,6 @@ function shouldMoveToTemp(context, expression, tsOriginal) {
|
|
|
17
20
|
(0, optional_chaining_1.isOptionalContinuation)(tsOriginal) ||
|
|
18
21
|
tsOriginal.kind === ts.SyntaxKind.ThisKeyword)));
|
|
19
22
|
}
|
|
20
|
-
exports.shouldMoveToTemp = shouldMoveToTemp;
|
|
21
23
|
// Cache an expression in a preceding statement and return the temp identifier
|
|
22
24
|
function moveToPrecedingTemp(context, expression, tsOriginal) {
|
|
23
25
|
if (!shouldMoveToTemp(context, expression, tsOriginal)) {
|
|
@@ -28,7 +30,6 @@ function moveToPrecedingTemp(context, expression, tsOriginal) {
|
|
|
28
30
|
context.addPrecedingStatements(tempDeclaration);
|
|
29
31
|
return lua.cloneIdentifier(tempIdentifier, tsOriginal);
|
|
30
32
|
}
|
|
31
|
-
exports.moveToPrecedingTemp = moveToPrecedingTemp;
|
|
32
33
|
function transformExpressions(context, expressions) {
|
|
33
34
|
const precedingStatements = [];
|
|
34
35
|
const transformedExpressions = [];
|
|
@@ -113,11 +114,9 @@ function transformExpressionList(context, expressions) {
|
|
|
113
114
|
return transformExpressionsUsingTemps(context, expressions, transformedExpressions, precedingStatements, lastPrecedingStatementsIndex);
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
|
-
exports.transformExpressionList = transformExpressionList;
|
|
117
117
|
// Transforms a series of expressions while maintaining execution order
|
|
118
118
|
function transformOrderedExpressions(context, expressions) {
|
|
119
119
|
const { transformedExpressions, precedingStatements, lastPrecedingStatementsIndex } = transformExpressions(context, expressions);
|
|
120
120
|
return transformExpressionsUsingTemps(context, expressions, transformedExpressions, precedingStatements, lastPrecedingStatementsIndex);
|
|
121
121
|
}
|
|
122
|
-
exports.transformOrderedExpressions = transformOrderedExpressions;
|
|
123
122
|
//# sourceMappingURL=expression-list.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.transformExpressionStatement = void 0;
|
|
4
|
+
exports.wrapInStatement = wrapInStatement;
|
|
4
5
|
const lua = require("../../LuaAST");
|
|
5
6
|
const context_1 = require("../context");
|
|
6
7
|
const binary_expression_1 = require("./binary-expression");
|
|
@@ -33,5 +34,4 @@ function wrapInStatement(result) {
|
|
|
33
34
|
// Assign expression statements to dummy to make sure they're legal Lua
|
|
34
35
|
return lua.createVariableDeclarationStatement(lua.createAnonymousIdentifier(), result);
|
|
35
36
|
}
|
|
36
|
-
exports.wrapInStatement = wrapInStatement;
|
|
37
37
|
//# sourceMappingURL=expression-statement.js.map
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformYieldExpression = exports.transformFunctionDeclaration =
|
|
3
|
+
exports.transformYieldExpression = exports.transformFunctionDeclaration = void 0;
|
|
4
|
+
exports.createCallableTable = createCallableTable;
|
|
5
|
+
exports.isFunctionTypeWithProperties = isFunctionTypeWithProperties;
|
|
6
|
+
exports.transformFunctionBodyContent = transformFunctionBodyContent;
|
|
7
|
+
exports.transformFunctionBodyHeader = transformFunctionBodyHeader;
|
|
8
|
+
exports.transformFunctionBody = transformFunctionBody;
|
|
9
|
+
exports.transformParameters = transformParameters;
|
|
10
|
+
exports.transformFunctionToExpression = transformFunctionToExpression;
|
|
11
|
+
exports.transformFunctionLikeDeclaration = transformFunctionLikeDeclaration;
|
|
4
12
|
const ts = require("typescript");
|
|
5
13
|
const CompilerOptions_1 = require("../../CompilerOptions");
|
|
6
14
|
const lua = require("../../LuaAST");
|
|
@@ -58,7 +66,6 @@ function createCallableTable(functionExpression) {
|
|
|
58
66
|
]),
|
|
59
67
|
]);
|
|
60
68
|
}
|
|
61
|
-
exports.createCallableTable = createCallableTable;
|
|
62
69
|
function isFunctionTypeWithProperties(context, functionType) {
|
|
63
70
|
if (functionType.isUnion()) {
|
|
64
71
|
return functionType.types.some(t => isFunctionTypeWithProperties(context, t));
|
|
@@ -70,7 +77,6 @@ function isFunctionTypeWithProperties(context, functionType) {
|
|
|
70
77
|
);
|
|
71
78
|
}
|
|
72
79
|
}
|
|
73
|
-
exports.isFunctionTypeWithProperties = isFunctionTypeWithProperties;
|
|
74
80
|
function transformFunctionBodyContent(context, body) {
|
|
75
81
|
if (!ts.isBlock(body)) {
|
|
76
82
|
const { precedingStatements, result: returnStatement } = (0, preceding_statements_1.transformInPrecedingStatementScope)(context, () => (0, return_1.transformExpressionBodyToReturnStatement)(context, body));
|
|
@@ -79,7 +85,6 @@ function transformFunctionBodyContent(context, body) {
|
|
|
79
85
|
const bodyStatements = (0, scope_1.performHoisting)(context, context.transformStatements(body.statements));
|
|
80
86
|
return bodyStatements;
|
|
81
87
|
}
|
|
82
|
-
exports.transformFunctionBodyContent = transformFunctionBodyContent;
|
|
83
88
|
function transformFunctionBodyHeader(context, bodyScope, parameters, spreadIdentifier) {
|
|
84
89
|
const headerStatements = [];
|
|
85
90
|
// Add default parameters and object binding patterns
|
|
@@ -115,7 +120,6 @@ function transformFunctionBodyHeader(context, bodyScope, parameters, spreadIdent
|
|
|
115
120
|
headerStatements.push(...bindingPatternDeclarations);
|
|
116
121
|
return headerStatements;
|
|
117
122
|
}
|
|
118
|
-
exports.transformFunctionBodyHeader = transformFunctionBodyHeader;
|
|
119
123
|
function transformFunctionBody(context, parameters, body, spreadIdentifier, node) {
|
|
120
124
|
const scope = context.pushScope(scope_1.ScopeType.Function);
|
|
121
125
|
scope.node = node;
|
|
@@ -127,7 +131,6 @@ function transformFunctionBody(context, parameters, body, spreadIdentifier, node
|
|
|
127
131
|
context.popScope();
|
|
128
132
|
return [[...headerStatements, ...bodyStatements], scope];
|
|
129
133
|
}
|
|
130
|
-
exports.transformFunctionBody = transformFunctionBody;
|
|
131
134
|
function transformParameters(context, parameters, functionContext) {
|
|
132
135
|
// Build parameter string
|
|
133
136
|
const paramNames = [];
|
|
@@ -159,7 +162,6 @@ function transformParameters(context, parameters, functionContext) {
|
|
|
159
162
|
}
|
|
160
163
|
return [paramNames, dotsLiteral, restParamName];
|
|
161
164
|
}
|
|
162
|
-
exports.transformParameters = transformParameters;
|
|
163
165
|
function transformFunctionToExpression(context, node) {
|
|
164
166
|
var _a;
|
|
165
167
|
(0, utils_1.assert)(node.body);
|
|
@@ -198,7 +200,6 @@ function transformFunctionToExpression(context, node) {
|
|
|
198
200
|
functionScope,
|
|
199
201
|
];
|
|
200
202
|
}
|
|
201
|
-
exports.transformFunctionToExpression = transformFunctionToExpression;
|
|
202
203
|
function transformFunctionLikeDeclaration(node, context) {
|
|
203
204
|
if (node.body === undefined) {
|
|
204
205
|
// This code can be reached only from object methods, which is TypeScript error
|
|
@@ -232,7 +233,6 @@ function transformFunctionLikeDeclaration(node, context) {
|
|
|
232
233
|
? createCallableTable(functionExpression)
|
|
233
234
|
: functionExpression;
|
|
234
235
|
}
|
|
235
|
-
exports.transformFunctionLikeDeclaration = transformFunctionLikeDeclaration;
|
|
236
236
|
const transformFunctionDeclaration = (node, context) => {
|
|
237
237
|
var _a;
|
|
238
238
|
// Don't transform functions without body (overload declarations)
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformIdentifierExpression =
|
|
3
|
+
exports.transformIdentifierExpression = void 0;
|
|
4
|
+
exports.transformIdentifier = transformIdentifier;
|
|
5
|
+
exports.getCustomNameFromSymbol = getCustomNameFromSymbol;
|
|
6
|
+
exports.transformIdentifierWithSymbol = transformIdentifierWithSymbol;
|
|
4
7
|
const ts = require("typescript");
|
|
5
8
|
const lua = require("../../LuaAST");
|
|
6
9
|
const builtins_1 = require("../builtins");
|
|
@@ -19,7 +22,6 @@ const annotations_1 = require("../utils/annotations");
|
|
|
19
22
|
function transformIdentifier(context, identifier) {
|
|
20
23
|
return transformNonValueIdentifier(context, identifier, context.checker.getSymbolAtLocation(identifier));
|
|
21
24
|
}
|
|
22
|
-
exports.transformIdentifier = transformIdentifier;
|
|
23
25
|
function getCustomNameFromSymbol(symbol) {
|
|
24
26
|
let retVal;
|
|
25
27
|
if (symbol) {
|
|
@@ -41,7 +43,6 @@ function getCustomNameFromSymbol(symbol) {
|
|
|
41
43
|
}
|
|
42
44
|
return retVal;
|
|
43
45
|
}
|
|
44
|
-
exports.getCustomNameFromSymbol = getCustomNameFromSymbol;
|
|
45
46
|
function transformNonValueIdentifier(context, identifier, symbol) {
|
|
46
47
|
if ((0, optional_chaining_1.isOptionalContinuation)(identifier)) {
|
|
47
48
|
const result = lua.createIdentifier(identifier.text, undefined, context_1.tempSymbolId);
|
|
@@ -95,7 +96,6 @@ function transformIdentifierWithSymbol(context, node, symbol) {
|
|
|
95
96
|
}
|
|
96
97
|
return transformNonValueIdentifier(context, node, symbol);
|
|
97
98
|
}
|
|
98
|
-
exports.transformIdentifierWithSymbol = transformIdentifierWithSymbol;
|
|
99
99
|
const transformIdentifierExpression = (node, context) => {
|
|
100
100
|
if (ts.identifierToKeywordKind(node) === ts.SyntaxKind.UndefinedKeyword) {
|
|
101
101
|
return lua.createNilLiteral(node);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.callExtensions = void 0;
|
|
4
|
+
exports.transformLanguageExtensionCallExpression = transformLanguageExtensionCallExpression;
|
|
4
5
|
const language_extensions_1 = require("../../utils/language-extensions");
|
|
5
6
|
const operators_1 = require("./operators");
|
|
6
7
|
const table_1 = require("./table");
|
|
@@ -19,5 +20,4 @@ function transformLanguageExtensionCallExpression(context, node) {
|
|
|
19
20
|
return transformer(context, node, extensionKind);
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
exports.transformLanguageExtensionCallExpression = transformLanguageExtensionCallExpression;
|
|
23
23
|
//# sourceMappingURL=call-extension.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isIdentifierExtensionValue = isIdentifierExtensionValue;
|
|
4
|
+
exports.reportInvalidExtensionValue = reportInvalidExtensionValue;
|
|
4
5
|
const language_extensions_1 = require("../../utils/language-extensions");
|
|
5
6
|
const diagnostics_1 = require("../../utils/diagnostics");
|
|
6
7
|
const extensionKindToValueName = {
|
|
@@ -11,7 +12,6 @@ const extensionKindToValueName = {
|
|
|
11
12
|
function isIdentifierExtensionValue(symbol, extensionKind) {
|
|
12
13
|
return symbol !== undefined && extensionKindToValueName[extensionKind] === symbol.name;
|
|
13
14
|
}
|
|
14
|
-
exports.isIdentifierExtensionValue = isIdentifierExtensionValue;
|
|
15
15
|
function reportInvalidExtensionValue(context, identifier, extensionKind) {
|
|
16
16
|
if (extensionKind === language_extensions_1.ExtensionKind.MultiFunction) {
|
|
17
17
|
context.diagnostics.push((0, diagnostics_1.invalidMultiFunctionUse)(identifier));
|
|
@@ -23,5 +23,4 @@ function reportInvalidExtensionValue(context, identifier, extensionKind) {
|
|
|
23
23
|
context.diagnostics.push((0, diagnostics_1.invalidVarargUse)(identifier));
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
exports.reportInvalidExtensionValue = reportInvalidExtensionValue;
|
|
27
26
|
//# sourceMappingURL=identifier.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.transformForOfIterableStatement = transformForOfIterableStatement;
|
|
4
|
+
exports.transformForOfPairsIterableStatement = transformForOfPairsIterableStatement;
|
|
5
|
+
exports.transformForOfPairsKeyIterableStatement = transformForOfPairsKeyIterableStatement;
|
|
4
6
|
const ts = require("typescript");
|
|
5
7
|
const lua = require("../../../LuaAST");
|
|
6
8
|
const utils_1 = require("../loops/utils");
|
|
@@ -51,14 +53,12 @@ function transformForOfIterableStatement(context, statement, block) {
|
|
|
51
53
|
const identifier = (0, utils_1.transformForInitializer)(context, statement.initializer, block);
|
|
52
54
|
return lua.createForInStatement(block, [identifier], [luaIterator], statement);
|
|
53
55
|
}
|
|
54
|
-
exports.transformForOfIterableStatement = transformForOfIterableStatement;
|
|
55
56
|
function transformForOfPairsIterableStatement(context, statement, block) {
|
|
56
57
|
const pairsCall = lua.createCallExpression(lua.createIdentifier("pairs"), [
|
|
57
58
|
context.transformExpression(statement.expression),
|
|
58
59
|
]);
|
|
59
60
|
return transformForOfMultiIterableStatement(context, statement, block, pairsCall, diagnostics_1.invalidPairsIterableWithoutDestructuring);
|
|
60
61
|
}
|
|
61
|
-
exports.transformForOfPairsIterableStatement = transformForOfPairsIterableStatement;
|
|
62
62
|
function transformForOfPairsKeyIterableStatement(context, statement, block) {
|
|
63
63
|
const pairsCall = lua.createCallExpression(lua.createIdentifier("pairs"), [
|
|
64
64
|
context.transformExpression(statement.expression),
|
|
@@ -66,5 +66,4 @@ function transformForOfPairsKeyIterableStatement(context, statement, block) {
|
|
|
66
66
|
const identifier = (0, utils_1.transformForInitializer)(context, statement.initializer, block);
|
|
67
67
|
return lua.createForInStatement(block, [identifier], [pairsCall], statement);
|
|
68
68
|
}
|
|
69
|
-
exports.transformForOfPairsKeyIterableStatement = transformForOfPairsKeyIterableStatement;
|
|
70
69
|
//# sourceMappingURL=iterable.js.map
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isMultiReturnType = isMultiReturnType;
|
|
4
|
+
exports.canBeMultiReturnType = canBeMultiReturnType;
|
|
5
|
+
exports.isMultiFunctionCall = isMultiFunctionCall;
|
|
6
|
+
exports.returnsMultiType = returnsMultiType;
|
|
7
|
+
exports.isMultiReturnCall = isMultiReturnCall;
|
|
8
|
+
exports.isMultiFunctionNode = isMultiFunctionNode;
|
|
9
|
+
exports.isInMultiReturnFunction = isInMultiReturnFunction;
|
|
10
|
+
exports.shouldMultiReturnCallBeWrapped = shouldMultiReturnCallBeWrapped;
|
|
4
11
|
const ts = require("typescript");
|
|
5
12
|
const extensions = require("../../utils/language-extensions");
|
|
6
13
|
const language_extensions_1 = require("../../utils/language-extensions");
|
|
@@ -9,33 +16,27 @@ const multiReturnExtensionName = "__tstlMultiReturn";
|
|
|
9
16
|
function isMultiReturnType(type) {
|
|
10
17
|
return type.getProperty(multiReturnExtensionName) !== undefined;
|
|
11
18
|
}
|
|
12
|
-
exports.isMultiReturnType = isMultiReturnType;
|
|
13
19
|
function canBeMultiReturnType(type) {
|
|
14
20
|
return ((type.flags & ts.TypeFlags.Any) !== 0 ||
|
|
15
21
|
isMultiReturnType(type) ||
|
|
16
22
|
(type.isUnion() && type.types.some(t => canBeMultiReturnType(t))));
|
|
17
23
|
}
|
|
18
|
-
exports.canBeMultiReturnType = canBeMultiReturnType;
|
|
19
24
|
function isMultiFunctionCall(context, expression) {
|
|
20
25
|
return isMultiFunctionNode(context, expression.expression);
|
|
21
26
|
}
|
|
22
|
-
exports.isMultiFunctionCall = isMultiFunctionCall;
|
|
23
27
|
function returnsMultiType(context, node) {
|
|
24
28
|
const signature = context.checker.getResolvedSignature(node);
|
|
25
29
|
const type = signature === null || signature === void 0 ? void 0 : signature.getReturnType();
|
|
26
30
|
return type ? isMultiReturnType(type) : false;
|
|
27
31
|
}
|
|
28
|
-
exports.returnsMultiType = returnsMultiType;
|
|
29
32
|
function isMultiReturnCall(context, expression) {
|
|
30
33
|
return ts.isCallExpression(expression) && returnsMultiType(context, expression);
|
|
31
34
|
}
|
|
32
|
-
exports.isMultiReturnCall = isMultiReturnCall;
|
|
33
35
|
function isMultiFunctionNode(context, node) {
|
|
34
36
|
return (ts.isIdentifier(node) &&
|
|
35
37
|
node.text === "$multi" &&
|
|
36
38
|
(0, language_extensions_1.getExtensionKindForNode)(context, node) === extensions.ExtensionKind.MultiFunction);
|
|
37
39
|
}
|
|
38
|
-
exports.isMultiFunctionNode = isMultiFunctionNode;
|
|
39
40
|
function isInMultiReturnFunction(context, node) {
|
|
40
41
|
const declaration = (0, typescript_1.findFirstNodeAbove)(node, ts.isFunctionLike);
|
|
41
42
|
if (!declaration) {
|
|
@@ -45,7 +46,6 @@ function isInMultiReturnFunction(context, node) {
|
|
|
45
46
|
const type = signature === null || signature === void 0 ? void 0 : signature.getReturnType();
|
|
46
47
|
return type ? isMultiReturnType(type) : false;
|
|
47
48
|
}
|
|
48
|
-
exports.isInMultiReturnFunction = isInMultiReturnFunction;
|
|
49
49
|
function shouldMultiReturnCallBeWrapped(context, node) {
|
|
50
50
|
if (!returnsMultiType(context, node)) {
|
|
51
51
|
return false;
|
|
@@ -85,5 +85,4 @@ function shouldMultiReturnCallBeWrapped(context, node) {
|
|
|
85
85
|
}
|
|
86
86
|
return true;
|
|
87
87
|
}
|
|
88
|
-
exports.shouldMultiReturnCallBeWrapped = shouldMultiReturnCallBeWrapped;
|
|
89
88
|
//# sourceMappingURL=multi.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isRangeFunction = isRangeFunction;
|
|
4
|
+
exports.isRangeFunctionNode = isRangeFunctionNode;
|
|
5
|
+
exports.transformRangeStatement = transformRangeStatement;
|
|
4
6
|
const ts = require("typescript");
|
|
5
7
|
const lua = require("../../../LuaAST");
|
|
6
8
|
const extensions = require("../../utils/language-extensions");
|
|
@@ -13,13 +15,11 @@ const language_extensions_1 = require("../../utils/language-extensions");
|
|
|
13
15
|
function isRangeFunction(context, expression) {
|
|
14
16
|
return isRangeFunctionNode(context, expression.expression);
|
|
15
17
|
}
|
|
16
|
-
exports.isRangeFunction = isRangeFunction;
|
|
17
18
|
function isRangeFunctionNode(context, node) {
|
|
18
19
|
return (ts.isIdentifier(node) &&
|
|
19
20
|
node.text === "$range" &&
|
|
20
21
|
(0, language_extensions_1.getExtensionKindForNode)(context, node) === extensions.ExtensionKind.RangeFunction);
|
|
21
22
|
}
|
|
22
|
-
exports.isRangeFunctionNode = isRangeFunctionNode;
|
|
23
23
|
function getControlVariable(context, statement) {
|
|
24
24
|
if (!ts.isVariableDeclarationList(statement.initializer)) {
|
|
25
25
|
context.diagnostics.push((0, diagnostics_1.invalidRangeControlVariable)(statement.initializer));
|
|
@@ -39,5 +39,4 @@ function transformRangeStatement(context, statement, block) {
|
|
|
39
39
|
const [start = lua.createNumericLiteral(0), limit = lua.createNumericLiteral(0), step] = (0, call_1.transformArguments)(context, statement.expression.arguments, context.checker.getResolvedSignature(statement.expression));
|
|
40
40
|
return lua.createForStatement(block, controlVariable, start, limit, step, statement);
|
|
41
41
|
}
|
|
42
|
-
exports.transformRangeStatement = transformRangeStatement;
|
|
43
42
|
//# sourceMappingURL=range.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tableExtensionTransformers = exports.tableNewExtensions =
|
|
3
|
+
exports.tableExtensionTransformers = exports.tableNewExtensions = void 0;
|
|
4
|
+
exports.isTableNewCall = isTableNewCall;
|
|
4
5
|
const lua = require("../../../LuaAST");
|
|
5
6
|
const language_extensions_1 = require("../../utils/language-extensions");
|
|
6
7
|
const expression_list_1 = require("../expression-list");
|
|
7
8
|
function isTableNewCall(context, node) {
|
|
8
9
|
return (0, language_extensions_1.getExtensionKindForNode)(context, node.expression) === language_extensions_1.ExtensionKind.TableNewType;
|
|
9
10
|
}
|
|
10
|
-
exports.isTableNewCall = isTableNewCall;
|
|
11
11
|
exports.tableNewExtensions = [language_extensions_1.ExtensionKind.TableNewType];
|
|
12
12
|
exports.tableExtensionTransformers = {
|
|
13
13
|
[language_extensions_1.ExtensionKind.TableDeleteType]: transformTableDeleteExpression,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isGlobalVarargConstant = isGlobalVarargConstant;
|
|
4
|
+
exports.isVarargConstantNode = isVarargConstantNode;
|
|
4
5
|
const extensions = require("../../utils/language-extensions");
|
|
5
6
|
const language_extensions_1 = require("../../utils/language-extensions");
|
|
6
7
|
const scope_1 = require("../../utils/scope");
|
|
7
8
|
function isGlobalVarargConstant(context, symbol, scope) {
|
|
8
9
|
return scope.type === scope_1.ScopeType.File && isVarargConstantSymbol(context, symbol);
|
|
9
10
|
}
|
|
10
|
-
exports.isGlobalVarargConstant = isGlobalVarargConstant;
|
|
11
11
|
function isVarargConstantSymbol(context, symbol) {
|
|
12
12
|
return (symbol.getName() === "$vararg" &&
|
|
13
13
|
(0, language_extensions_1.getExtensionKindForSymbol)(context, symbol) === extensions.ExtensionKind.VarargConstant);
|
|
@@ -16,5 +16,4 @@ function isVarargConstantNode(context, node) {
|
|
|
16
16
|
const symbol = context.checker.getSymbolAtLocation(node);
|
|
17
17
|
return symbol !== undefined && isVarargConstantSymbol(context, symbol);
|
|
18
18
|
}
|
|
19
|
-
exports.isVarargConstantNode = isVarargConstantNode;
|
|
20
19
|
//# sourceMappingURL=vararg.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.literalVisitors =
|
|
3
|
+
exports.literalVisitors = void 0;
|
|
4
|
+
exports.transformPropertyName = transformPropertyName;
|
|
5
|
+
exports.createShorthandIdentifier = createShorthandIdentifier;
|
|
4
6
|
const ts = require("typescript");
|
|
5
7
|
const lua = require("../../LuaAST");
|
|
6
8
|
const utils_1 = require("../../utils");
|
|
@@ -27,11 +29,9 @@ function transformPropertyName(context, node) {
|
|
|
27
29
|
return context.transformExpression(node);
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
|
-
exports.transformPropertyName = transformPropertyName;
|
|
31
32
|
function createShorthandIdentifier(context, valueSymbol, propertyIdentifier) {
|
|
32
33
|
return (0, identifier_1.transformIdentifierWithSymbol)(context, propertyIdentifier, valueSymbol);
|
|
33
34
|
}
|
|
34
|
-
exports.createShorthandIdentifier = createShorthandIdentifier;
|
|
35
35
|
const transformNumericLiteralExpression = (expression, context) => {
|
|
36
36
|
if (expression.text === "Infinity") {
|
|
37
37
|
if (context.luaTarget === CompilerOptions_1.LuaTarget.Lua50) {
|