typescript-to-lua 1.26.1 → 1.26.2
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.
|
@@ -115,7 +115,10 @@ function transformClassLikeDeclaration(classDeclaration, context, nameOverride)
|
|
|
115
115
|
for (const member of classDeclaration.members) {
|
|
116
116
|
if (ts.isAccessor(member)) {
|
|
117
117
|
// Accessors
|
|
118
|
-
const
|
|
118
|
+
const symbol = context.checker.getSymbolAtLocation(member.name);
|
|
119
|
+
if (!symbol)
|
|
120
|
+
continue;
|
|
121
|
+
const accessors = getAllAccessorDeclarations(classDeclaration, symbol, context);
|
|
119
122
|
if (accessors.firstAccessor !== member)
|
|
120
123
|
continue;
|
|
121
124
|
const accessorsResult = (0, accessors_1.transformAccessorDeclarations)(context, accessors, localClassName);
|
|
@@ -161,9 +164,9 @@ function transformClassLikeDeclaration(classDeclaration, context, nameOverride)
|
|
|
161
164
|
context.classSuperInfos.pop();
|
|
162
165
|
return { statements: result, name: className };
|
|
163
166
|
}
|
|
164
|
-
function getAllAccessorDeclarations(classDeclaration) {
|
|
165
|
-
const getAccessor = classDeclaration.members.find(ts.isGetAccessor);
|
|
166
|
-
const setAccessor = classDeclaration.members.find(ts.isSetAccessor);
|
|
167
|
+
function getAllAccessorDeclarations(classDeclaration, symbol, context) {
|
|
168
|
+
const getAccessor = classDeclaration.members.find((m) => ts.isGetAccessor(m) && context.checker.getSymbolAtLocation(m.name) === symbol);
|
|
169
|
+
const setAccessor = classDeclaration.members.find((m) => ts.isSetAccessor(m) && context.checker.getSymbolAtLocation(m.name) === symbol);
|
|
167
170
|
// Get the first of the two (that is not undefined)
|
|
168
171
|
const firstAccessor = getAccessor && (!setAccessor || getAccessor.pos < setAccessor.pos) ? getAccessor : setAccessor;
|
|
169
172
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typescript-to-lua",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.2",
|
|
4
4
|
"description": "A generic TypeScript to Lua transpiler. Write your code in TypeScript and publish Lua!",
|
|
5
5
|
"repository": "https://github.com/TypeScriptToLua/TypeScriptToLua",
|
|
6
6
|
"homepage": "https://typescripttolua.github.io/",
|