Skip to content

Commit 66642ac

Browse files
committed
Made : default except for namespaces
1 parent 38b9970 commit 66642ac

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Transpiler.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -791,18 +791,17 @@ export class LuaTranspiler {
791791
return this.transpileArrayCallExpression(node);
792792
}
793793

794-
if (expType.symbol && ((expType.symbol.flags & ts.SymbolFlags.Interface) || (expType.symbol.flags & ts.SymbolFlags.Class))) {
795-
// Replace . with : here
796-
const callPath = `${this.transpileExpression(node.expression.expression)}:${node.expression.name.escapedText}`;
794+
if (expType.symbol && (expType.symbol.flags & ts.SymbolFlags.Namespace)) {
795+
// Don't replace . with : for namespaces
796+
const callPath = this.transpileExpression(node.expression);
797797
const params = this.transpileArguments(node.arguments);
798798
return `${callPath}(${params})`;
799799
} else {
800-
const callPath = this.transpileExpression(node.expression);
800+
// Replace last . with : here
801+
const callPath = `${this.transpileExpression(node.expression.expression)}:${node.expression.name.escapedText}`;
801802
const params = this.transpileArguments(node.arguments);
802803
return `${callPath}(${params})`;
803804
}
804-
805-
806805
}
807806

808807
// Handle super calls properly

0 commit comments

Comments
 (0)