@@ -346,7 +346,7 @@ export abstract class LuaTranspiler {
346346 public transpileNamespace ( node : ts . ModuleDeclaration ) : string {
347347 const decorators = tsHelper . getCustomDecorators ( this . checker . getTypeAtLocation ( node ) , this . checker ) ;
348348 // If phantom namespace just transpile the body as normal
349- if ( decorators . hasDecorator ( DecoratorKind . Phantom ) && node . body ) {
349+ if ( decorators . has ( DecoratorKind . Phantom ) && node . body ) {
350350 return this . transpileNode ( node . body ) ;
351351 }
352352
@@ -379,7 +379,7 @@ export abstract class LuaTranspiler {
379379
380380 const type = this . checker . getTypeAtLocation ( node ) ;
381381 const membersOnly = tsHelper . getCustomDecorators ( type , this . checker )
382- . hasDecorator ( DecoratorKind . CompileMembersOnly ) ;
382+ . has ( DecoratorKind . CompileMembersOnly ) ;
383383
384384 if ( ! membersOnly ) {
385385 const name = this . transpileIdentifier ( node . name ) ;
@@ -690,7 +690,7 @@ export abstract class LuaTranspiler {
690690 this . checker . getTypeAtLocation ( declaration ) ,
691691 this . checker
692692 ) ;
693- isTupleReturn = decorators . hasDecorator ( DecoratorKind . TupleReturn ) ;
693+ isTupleReturn = decorators . has ( DecoratorKind . TupleReturn ) ;
694694 }
695695 if ( isTupleReturn && ts . isArrayLiteralExpression ( node . expression ) ) {
696696 return "return " + node . expression . elements . map ( elem => this . transpileExpression ( elem ) ) . join ( "," ) ;
@@ -1045,8 +1045,8 @@ export abstract class LuaTranspiler {
10451045
10461046 this . checkForLuaLibType ( type ) ;
10471047
1048- if ( classDecorators . hasDecorator ( DecoratorKind . CustomConstructor ) ) {
1049- const customDecorator = classDecorators . getDecorator ( DecoratorKind . CustomConstructor ) ;
1048+ if ( classDecorators . has ( DecoratorKind . CustomConstructor ) ) {
1049+ const customDecorator = classDecorators . get ( DecoratorKind . CustomConstructor ) ;
10501050 if ( ! customDecorator . args [ 0 ] ) {
10511051 throw new TranspileError ( "!CustomConstructor requires one argument" , node ) ;
10521052 }
@@ -1268,7 +1268,7 @@ export abstract class LuaTranspiler {
12681268
12691269 const decorators = tsHelper . getCustomDecorators ( type , this . checker ) ;
12701270 // Do not output path for member only enums
1271- if ( decorators . hasDecorator ( DecoratorKind . CompileMembersOnly ) ) {
1271+ if ( decorators . has ( DecoratorKind . CompileMembersOnly ) ) {
12721272 return property ;
12731273 }
12741274
@@ -1561,9 +1561,9 @@ export abstract class LuaTranspiler {
15611561 const decorators = tsHelper . getCustomDecorators ( this . checker . getTypeAtLocation ( node ) , this . checker ) ;
15621562
15631563 // Find out if this class is extension of existing class
1564- const isExtension = decorators . hasDecorator ( DecoratorKind . Extension ) ;
1564+ const isExtension = decorators . has ( DecoratorKind . Extension ) ;
15651565
1566- const isMetaExtension = decorators . hasDecorator ( DecoratorKind . MetaExtension ) ;
1566+ const isMetaExtension = decorators . has ( DecoratorKind . MetaExtension ) ;
15671567
15681568 if ( isExtension && isMetaExtension ) {
15691569 throw new TranspileError (
@@ -1607,7 +1607,7 @@ export abstract class LuaTranspiler {
16071607 }
16081608
16091609 if ( isExtension ) {
1610- const extensionNameArg = decorators . getDecorator ( DecoratorKind . Extension ) . args [ 0 ] ;
1610+ const extensionNameArg = decorators . get ( DecoratorKind . Extension ) . args [ 0 ] ;
16111611 if ( extensionNameArg ) {
16121612 className = extensionNameArg ;
16131613 } else if ( extendsType ) {
@@ -1658,7 +1658,7 @@ export abstract class LuaTranspiler {
16581658 let noClassOr = false ;
16591659 if ( extendsType ) {
16601660 const decorators = tsHelper . getCustomDecorators ( extendsType , this . checker ) ;
1661- noClassOr = decorators . hasDecorator ( DecoratorKind . NoClassOr ) ;
1661+ noClassOr = decorators . has ( DecoratorKind . NoClassOr ) ;
16621662 }
16631663
16641664 let result = "" ;
0 commit comments