We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 36c2376 + d6c2180 commit eb65053Copy full SHA for eb65053
src/Transpiler.ts
@@ -337,7 +337,11 @@ export class LuaTranspiler {
337
}
338
339
transpileReturn(node: ts.ReturnStatement): string {
340
- return "return " + this.transpileExpression(node.expression);
+ if (node.expression) {
341
+ return "return " + this.transpileExpression(node.expression);
342
+ } else {
343
+ return "return"
344
+ }
345
346
347
transpileExpression(node: ts.Node, brackets?: boolean): string {
@@ -941,4 +945,4 @@ export class LuaTranspiler {
941
945
return `function(${paramNames.join(",")}) return ` + this.transpileExpression(node.body) + " end";
942
946
943
947
944
-}
948
+}
0 commit comments