@@ -37,7 +37,7 @@ namespace ts {
3737 return ModuleInstanceState . ConstEnumOnly ;
3838 }
3939 // 3. non-exported import declarations
40- else if ( ( node . kind === SyntaxKind . ImportDeclaration || node . kind === SyntaxKind . ImportEqualsDeclaration ) && ! ( node . flags & NodeFlags . Export ) ) {
40+ else if ( ( node . kind === SyntaxKind . ImportDeclaration || node . kind === SyntaxKind . ImportEqualsDeclaration ) && ! ( getModifierFlags ( node ) & ModifierFlags . Export ) ) {
4141 return ModuleInstanceState . NonInstantiated ;
4242 }
4343 // 4. other uninstantiated module declarations.
@@ -256,7 +256,7 @@ namespace ts {
256256
257257 case SyntaxKind . FunctionDeclaration :
258258 case SyntaxKind . ClassDeclaration :
259- return node . flags & NodeFlags . Default ? "default" : undefined ;
259+ return getModifierFlags ( node ) & ModifierFlags . Default ? "default" : undefined ;
260260 case SyntaxKind . JSDocFunctionType :
261261 return isJSDocConstructSignature ( node ) ? "__new" : "__call" ;
262262 case SyntaxKind . Parameter :
@@ -284,7 +284,7 @@ namespace ts {
284284 function declareSymbol ( symbolTable : SymbolTable , parent : Symbol , node : Declaration , includes : SymbolFlags , excludes : SymbolFlags ) : Symbol {
285285 Debug . assert ( ! hasDynamicName ( node ) ) ;
286286
287- const isDefaultExport = node . flags & NodeFlags . Default ;
287+ const isDefaultExport = getModifierFlags ( node ) & ModifierFlags . Default ;
288288 // The exported symbol for an export default function/class node is always named "default"
289289 const name = isDefaultExport && parent ? "default" : getDeclarationName ( node ) ;
290290
@@ -329,7 +329,7 @@ namespace ts {
329329 : Diagnostics . Duplicate_identifier_0 ;
330330
331331 forEach ( symbol . declarations , declaration => {
332- if ( declaration . flags & NodeFlags . Default ) {
332+ if ( getModifierFlags ( declaration ) & ModifierFlags . Default ) {
333333 message = Diagnostics . A_module_cannot_have_multiple_default_exports ;
334334 }
335335 } ) ;
@@ -353,7 +353,7 @@ namespace ts {
353353 }
354354
355355 function declareModuleMember ( node : Declaration , symbolFlags : SymbolFlags , symbolExcludes : SymbolFlags ) : Symbol {
356- const hasExportModifier = getCombinedNodeFlags ( node ) & NodeFlags . Export ;
356+ const hasExportModifier = getCombinedModifierFlags ( node ) & ModifierFlags . Export ;
357357 if ( symbolFlags & SymbolFlags . Alias ) {
358358 if ( node . kind === SyntaxKind . ExportSpecifier || ( node . kind === SyntaxKind . ImportEqualsDeclaration && hasExportModifier ) ) {
359359 return declareSymbol ( container . symbol . exports , container . symbol , node , symbolFlags , symbolExcludes ) ;
@@ -862,7 +862,7 @@ namespace ts {
862862 }
863863
864864 function declareClassMember ( node : Declaration , symbolFlags : SymbolFlags , symbolExcludes : SymbolFlags ) {
865- return node . flags & NodeFlags . Static
865+ return getModifierFlags ( node ) & ModifierFlags . Static
866866 ? declareSymbol ( container . symbol . exports , container . symbol , node , symbolFlags , symbolExcludes )
867867 : declareSymbol ( container . symbol . members , container . symbol , node , symbolFlags , symbolExcludes ) ;
868868 }
@@ -899,7 +899,7 @@ namespace ts {
899899 function bindModuleDeclaration ( node : ModuleDeclaration ) {
900900 setExportContextFlag ( node ) ;
901901 if ( isAmbientModule ( node ) ) {
902- if ( node . flags & NodeFlags . Export ) {
902+ if ( getModifierFlags ( node ) & ModifierFlags . Export ) {
903903 errorOnFirstToken ( node , Diagnostics . export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible ) ;
904904 }
905905 declareSymbolAndAddToSymbolTable ( node , SymbolFlags . ValueModule , SymbolFlags . ValueModuleExcludes ) ;
@@ -1800,7 +1800,7 @@ namespace ts {
18001800 */
18011801 export function computeTransformFlagsForNode ( node : Node , subtreeFlags : TransformFlags ) : TransformFlags {
18021802 // Ambient nodes are TypeScript syntax and the flags of their subtree are ignored.
1803- if ( node . flags & NodeFlags . Ambient ) {
1803+ if ( getModifierFlags ( node ) & ModifierFlags . Ambient ) {
18041804 return ( node . transformFlags = TransformFlags . AssertTypeScript )
18051805 & ~ ( node . excludeTransformFlags = TransformFlags . NodeExcludes ) ;
18061806 }
@@ -2008,7 +2008,7 @@ namespace ts {
20082008 }
20092009
20102010 // If a parameter has an accessibility modifier, then it is TypeScript syntax.
2011- if ( ( < ParameterDeclaration > node ) . flags & NodeFlags . AccessibilityModifier ) {
2011+ if ( getModifierFlags ( node ) & ModifierFlags . AccessibilityModifier ) {
20122012 transformFlags |= TransformFlags . AssertTypeScript | TransformFlags . ContainsParameterPropertyAssignments ;
20132013 }
20142014
@@ -2033,7 +2033,7 @@ namespace ts {
20332033 }
20342034
20352035 // An async arrow function is TypeScript syntax.
2036- if ( node . flags & NodeFlags . Async ) {
2036+ if ( getModifierFlags ( node ) & ModifierFlags . Async ) {
20372037 transformFlags |= TransformFlags . AssertTypeScript ;
20382038 }
20392039
@@ -2052,7 +2052,7 @@ namespace ts {
20522052 }
20532053
20542054 // An async function expression is TypeScript syntax.
2055- if ( node . flags & NodeFlags . Async ) {
2055+ if ( getModifierFlags ( node ) & ModifierFlags . Async ) {
20562056 transformFlags |= TransformFlags . AssertTypeScript ;
20572057 }
20582058
@@ -2072,14 +2072,14 @@ namespace ts {
20722072 // subtree has marked the container as needing to capture the lexical `this`,
20732073 // then this node is ES6 syntax.
20742074 if ( ( < FunctionDeclaration > node ) . asteriskToken
2075- || node . flags & NodeFlags . Export
2075+ || getModifierFlags ( node ) & ModifierFlags . Export
20762076 || subtreeFlags & TransformFlags . ContainsCapturedLexicalThis
20772077 || subtreeFlags & TransformFlags . ContainsDefaultValueAssignments ) {
20782078 transformFlags |= TransformFlags . AssertES6 ;
20792079 }
20802080
20812081 // An async function declaration is TypeScript syntax.
2082- if ( node . flags & NodeFlags . Async ) {
2082+ if ( getModifierFlags ( node ) & ModifierFlags . Async ) {
20832083 transformFlags |= TransformFlags . AssertTypeScript ;
20842084 }
20852085
@@ -2103,7 +2103,7 @@ namespace ts {
21032103
21042104 case SyntaxKind . VariableStatement :
21052105 // If a VariableStatement is exported, then it is either ES6 or TypeScript syntax.
2106- if ( node . flags & NodeFlags . Export ) {
2106+ if ( getModifierFlags ( node ) & ModifierFlags . Export ) {
21072107 transformFlags |= TransformFlags . AssertES6 | TransformFlags . AssertTypeScript ;
21082108 }
21092109
@@ -2204,8 +2204,7 @@ namespace ts {
22042204 // generic, or has both a computed property name and a decorator.
22052205 if ( ( < MethodDeclaration > node ) . body === undefined
22062206 || ( < MethodDeclaration > node ) . typeParameters !== undefined
2207- || node . flags & NodeFlags . Async
2208- || node . flags & NodeFlags . Abstract
2207+ || getModifierFlags ( node ) & ( ModifierFlags . Async | ModifierFlags . Abstract )
22092208 || ( subtreeFlags & TransformFlags . ContainsDecorators
22102209 && subtreeFlags & TransformFlags . ContainsComputedPropertyName ) ) {
22112210 transformFlags |= TransformFlags . AssertTypeScript ;
@@ -2220,7 +2219,7 @@ namespace ts {
22202219
22212220 // A GetAccessor or SetAccessor is TypeScript syntax if it is either abstract,
22222221 // or has both a computed property name and a decorator.
2223- if ( node . flags & NodeFlags . Abstract ||
2222+ if ( getModifierFlags ( node ) & ModifierFlags . Abstract ||
22242223 subtreeFlags & TransformFlags . ContainsDecorators &&
22252224 subtreeFlags & TransformFlags . ContainsComputedPropertyName ) {
22262225 transformFlags |= TransformFlags . AssertTypeScript ;
0 commit comments