Skip to content

Commit 54839d7

Browse files
committed
Merge branch 'experimental'
2 parents 0139c88 + ce44bfb commit 54839d7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

dist/Transpiler.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,8 @@ var LuaTranspiler = /** @class */ (function () {
538538
return this.transpileArrayCallExpression(node);
539539
}
540540
// Include context parameter if present
541-
var callPath_1 = this.transpileExpression(node.expression);
541+
var expType = this.checker.getTypeAtLocation(node.expression.expression);
542+
var callPath_1 = (expType && expType.symbol) ? expType.symbol.name + "." + node.expression.name.escapedText : this.transpileExpression(node.expression);
542543
var params_1 = this.transpileArguments(node.arguments, node.expression.expression);
543544
return callPath_1 + "(" + params_1 + ")";
544545
}

src/Transpiler.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,10 @@ export class LuaTranspiler {
589589
}
590590

591591
// Include context parameter if present
592-
let callPath = this.transpileExpression(node.expression);
593-
const params = this.transpileArguments(node.arguments, node.expression.expression);
592+
const expType = this.checker.getTypeAtLocation(node.expression.expression);
593+
let callPath = (expType && expType.symbol) ? `${expType.symbol.name}.${node.expression.name.escapedText}` : this.transpileExpression(node.expression);
594+
let params = this.transpileArguments(node.arguments, node.expression.expression);
595+
594596
return `${callPath}(${params})`;
595597
}
596598

0 commit comments

Comments
 (0)