@@ -426,15 +426,13 @@ public Void visit(Identifier nd, Void v) {
426426 // cases where we turn on the 'declKind' flags
427427 @ Override
428428 public Void visit (FunctionDeclaration nd , Void v ) {
429- if (nd .hasDeclareKeyword () && !isInTypeScriptDeclarationFile ()) return null ;
430429 // strict mode functions are block-scoped, non-strict mode ones aren't
431430 if (blockscope == isStrict ) visit (nd .getId (), DeclKind .var );
432431 return null ;
433432 }
434433
435434 @ Override
436435 public Void visit (ClassDeclaration nd , Void c ) {
437- if (nd .hasDeclareKeyword () && !isInTypeScriptDeclarationFile ()) return null ;
438436 if (blockscope ) visit (nd .getClassDef ().getId (), DeclKind .varAndType );
439437 return null ;
440438 }
@@ -483,7 +481,6 @@ public Void visit(EnhancedForStatement nd, Void v) {
483481
484482 @ Override
485483 public Void visit (VariableDeclaration nd , Void v ) {
486- if (nd .hasDeclareKeyword () && !isInTypeScriptDeclarationFile ()) return null ;
487484 // in block scoping mode, only process 'let'; in non-block scoping
488485 // mode, only process non-'let'
489486 if (blockscope == nd .isBlockScoped (ecmaVersion )) visit (nd .getDeclarations ());
@@ -518,8 +515,7 @@ public Void visit(ClassBody nd, Void c) {
518515 @ Override
519516 public Void visit (NamespaceDeclaration nd , Void c ) {
520517 if (blockscope ) return null ;
521- boolean isAmbientOutsideDtsFile = nd .hasDeclareKeyword () && !isInTypeScriptDeclarationFile ();
522- boolean hasVariable = nd .isInstantiated () && !isAmbientOutsideDtsFile ;
518+ boolean hasVariable = nd .isInstantiated ();
523519 visit (nd .getName (), hasVariable ? DeclKind .varAndNamespace : DeclKind .namespace );
524520 return null ;
525521 }
0 commit comments