File tree Expand file tree Collapse file tree 2 files changed +5
-16
lines changed
Expand file tree Collapse file tree 2 files changed +5
-16
lines changed Original file line number Diff line number Diff line change 11import * as path from "path" ;
22import * as ts from "typescript" ;
33import { CompilerOptions , LuaTarget } from "./CompilerOptions" ;
4- import { DecoratorKind } from "./Decorator" ;
4+ import { Decorator , DecoratorKind } from "./Decorator" ;
55import * as tstl from "./LuaAST" ;
66import { LuaLibFeature } from "./LuaLib" ;
77import { ContextType , TSHelper as tsHelper } from "./TSHelper" ;
@@ -360,17 +360,10 @@ export class LuaTransformer {
360360 let shouldResolve = true ;
361361 const moduleOwnerSymbol = this . checker . getSymbolAtLocation ( statement . moduleSpecifier ) ;
362362 if ( moduleOwnerSymbol ) {
363- for ( const declaration of moduleOwnerSymbol . declarations ) {
364- if ( tsHelper . isNonNamespaceModuleDeclaration ( declaration ) ) {
365- const type = this . checker . getTypeAtLocation ( declaration ) ;
366- if ( type ) {
367- const decorators = tsHelper . getCustomDecorators ( type , this . checker ) ;
368- if ( decorators . has ( DecoratorKind . NoResolution ) ) {
369- shouldResolve = false ;
370- break ;
371- }
372- }
373- }
363+ const decMap = new Map < DecoratorKind , Decorator > ( ) ;
364+ tsHelper . collectCustomDecorators ( moduleOwnerSymbol , this . checker , decMap ) ;
365+ if ( decMap . has ( DecoratorKind . NoResolution ) ) {
366+ shouldResolve = false ;
374367 }
375368 }
376369
Original file line number Diff line number Diff line change @@ -131,10 +131,6 @@ export class TSHelper {
131131 return ! ( ( ts . getCombinedModifierFlags ( node ) & ts . ModifierFlags . Ambient ) === 0 ) ;
132132 }
133133
134- public static isNonNamespaceModuleDeclaration ( node : ts . Node ) : node is ts . ModuleDeclaration {
135- return ts . isModuleDeclaration ( node ) && ( node . flags & ts . NodeFlags . Namespace ) === 0 ;
136- }
137-
138134 public static isStatic ( node : ts . Node ) : boolean {
139135 return node . modifiers !== undefined && node . modifiers . some ( m => m . kind === ts . SyntaxKind . StaticKeyword ) ;
140136 }
You can’t perform that action at this time.
0 commit comments