File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -784,6 +784,12 @@ var LuaTranspiler = /** @class */ (function () {
784784 node . members . filter ( ts . isMethodDeclaration ) . forEach ( function ( method ) {
785785 result += _this . transpileMethodDeclaration ( method , className + "." ) ;
786786 } ) ;
787+ // Check if the class should be returned
788+ var isExport = node . modifiers && node . modifiers . some ( function ( _ ) { return _ . kind == ts . SyntaxKind . ExportKeyword ; } ) ;
789+ var isDefault = node . modifiers && node . modifiers . some ( function ( _ ) { return _ . kind == ts . SyntaxKind . DefaultKeyword ; } ) ;
790+ if ( isExport && isDefault ) {
791+ result += this . indent + ( "return " + className + "\n" ) ;
792+ }
787793 return result ;
788794 } ;
789795 LuaTranspiler . prototype . transpileConstructor = function ( node , className , instanceFields ) {
Original file line number Diff line number Diff line change @@ -852,6 +852,13 @@ export class LuaTranspiler {
852852 result += this . transpileMethodDeclaration ( method , `${ className } .` ) ;
853853 } ) ;
854854
855+ // Check if the class should be returned
856+ const isExport = node . modifiers && node . modifiers . some ( _ => _ . kind == ts . SyntaxKind . ExportKeyword ) ;
857+ const isDefault = node . modifiers && node . modifiers . some ( _ => _ . kind == ts . SyntaxKind . DefaultKeyword ) ;
858+ if ( isExport && isDefault ) {
859+ result += this . indent + `return ${ className } \n` ;
860+ }
861+
855862 return result ;
856863 }
857864
You can’t perform that action at this time.
0 commit comments