@@ -600,7 +600,7 @@ export class LuaTranspiler {
600600 return this . transpileExpression ( ( node as ts . DeleteExpression ) . expression ) + "=nil" ;
601601 case ts . SyntaxKind . FunctionExpression :
602602 case ts . SyntaxKind . ArrowFunction :
603- return this . transpileArrowFunction ( node as ts . ArrowFunction ) ;
603+ return this . transpileFunctionExpression ( node as ts . ArrowFunction ) ;
604604 case ts . SyntaxKind . NewExpression :
605605 return this . transpileNewExpression ( node as ts . NewExpression ) ;
606606 case ts . SyntaxKind . ComputedPropertyName :
@@ -1363,21 +1363,7 @@ export class LuaTranspiler {
13631363 return "{" + properties . join ( "," ) + "}" ;
13641364 }
13651365
1366- public transpileFunctionExpression ( node : ts . FunctionExpression ) : string {
1367- // Build parameter string
1368- const paramNames : string [ ] = [ ] ;
1369- node . parameters . forEach ( ( param ) => {
1370- paramNames . push ( ( param . name as ts . Identifier ) . escapedText as string ) ;
1371- } ) ;
1372-
1373- let result = `function(${ paramNames . join ( "," ) } )\n` ;
1374- this . pushIndent ( ) ;
1375- result += this . transpileBlock ( node . body ) ;
1376- this . popIndent ( ) ;
1377- return result + this . indent + "end\n" ;
1378- }
1379-
1380- public transpileArrowFunction ( node : ts . ArrowFunction ) : string {
1366+ public transpileFunctionExpression ( node : ts . ArrowFunction ) : string {
13811367 // Build parameter string
13821368 const paramNames : string [ ] = [ ] ;
13831369 node . parameters . forEach ( ( param ) => {
0 commit comments