File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -496,7 +496,8 @@ var LuaTranspiler = /** @class */ (function () {
496496 return this . transpileArrayCallExpression ( node ) ;
497497 }
498498 // Include context parameter if present
499- var callPath_1 = this . transpileExpression ( node . expression ) ;
499+ var expType = this . checker . getTypeAtLocation ( node . expression . expression ) ;
500+ var callPath_1 = ( expType && expType . symbol ) ? expType . symbol . name + "." + node . expression . name . escapedText : this . transpileExpression ( node . expression ) ;
500501 var params_1 = this . transpileArguments ( node . arguments , node . expression . expression ) ;
501502 return callPath_1 + "(" + params_1 + ")" ;
502503 }
@@ -561,6 +562,8 @@ var LuaTranspiler = /** @class */ (function () {
561562 return "TS_slice(" + caller + ", " + params + ")" ;
562563 case "splice" :
563564 return "TS_splice(" + caller + ", " + params + ")" ;
565+ case "join" :
566+ return "table.concat(" + caller + ", " + params + ")" ;
564567 default :
565568 throw new TranspileError ( "Unsupported array function: " + expression . name . escapedText , node ) ;
566569 }
Original file line number Diff line number Diff line change @@ -540,8 +540,10 @@ export class LuaTranspiler {
540540 }
541541
542542 // Include context parameter if present
543- let callPath = this . transpileExpression ( node . expression ) ;
544- const params = this . transpileArguments ( node . arguments , node . expression . expression ) ;
543+ const expType = this . checker . getTypeAtLocation ( node . expression . expression ) ;
544+ let callPath = ( expType && expType . symbol ) ? `${ expType . symbol . name } .${ node . expression . name . escapedText } ` : this . transpileExpression ( node . expression ) ;
545+ let params = this . transpileArguments ( node . arguments , node . expression . expression ) ;
546+
545547 return `${ callPath } (${ params } )` ;
546548 }
547549
You can’t perform that action at this time.
0 commit comments