Skip to content

Commit 244b568

Browse files
authored
Sourcemap super call (#1322)
* Fix super call source mapping * Fixed some more missing source mappings in call expressions * Remove stray debug
1 parent dd33492 commit 244b568

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/transformation/visitors/call.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ function transformPropertyCall(
183183
if (calledMethod.expression.kind === ts.SyntaxKind.SuperKeyword) {
184184
// Super calls take the format of super.call(self,...)
185185
const parameters = transformArguments(context, node.arguments, signature, ts.factory.createThis());
186-
return lua.createCallExpression(context.transformExpression(node.expression), parameters);
186+
return lua.createCallExpression(context.transformExpression(node.expression), parameters, node);
187187
}
188188

189189
const signatureDeclaration = signature?.getDeclaration();
@@ -207,7 +207,7 @@ function transformElementCall(context: TransformationContext, node: ts.CallExpre
207207
} else {
208208
// No context
209209
const [expression, parameters] = transformCallAndArguments(context, node.expression, node.arguments, signature);
210-
return lua.createCallExpression(expression, parameters);
210+
return lua.createCallExpression(expression, parameters, node);
211211
}
212212
}
213213

@@ -257,7 +257,8 @@ export const transformCallExpression: FunctionVisitor<ts.CallExpression> = (node
257257
context.transformExpression(ts.factory.createSuper()),
258258
lua.createStringLiteral("____constructor")
259259
),
260-
parameters
260+
parameters,
261+
node
261262
);
262263
}
263264

test/transpile/module-resolution.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,6 @@ test("supports complicated paths configuration", () => {
583583
util.testProject(projectTsConfig)
584584
.setMainFileName(mainFile)
585585
.setOptions({ luaBundle: "bundle.lua", luaBundleEntry: mainFile })
586-
.debug()
587586
.expectToEqual({ foo: 314, bar: 271 });
588587
});
589588

0 commit comments

Comments
 (0)