@@ -426,15 +426,13 @@ public Void visit(Identifier nd, Void v) {
426
426
// cases where we turn on the 'declKind' flags
427
427
@ Override
428
428
public Void visit (FunctionDeclaration nd , Void v ) {
429
- if (nd .hasDeclareKeyword () && !isInTypeScriptDeclarationFile ()) return null ;
430
429
// strict mode functions are block-scoped, non-strict mode ones aren't
431
430
if (blockscope == isStrict ) visit (nd .getId (), DeclKind .var );
432
431
return null ;
433
432
}
434
433
435
434
@ Override
436
435
public Void visit (ClassDeclaration nd , Void c ) {
437
- if (nd .hasDeclareKeyword () && !isInTypeScriptDeclarationFile ()) return null ;
438
436
if (blockscope ) visit (nd .getClassDef ().getId (), DeclKind .varAndType );
439
437
return null ;
440
438
}
@@ -483,7 +481,6 @@ public Void visit(EnhancedForStatement nd, Void v) {
483
481
484
482
@ Override
485
483
public Void visit (VariableDeclaration nd , Void v ) {
486
- if (nd .hasDeclareKeyword () && !isInTypeScriptDeclarationFile ()) return null ;
487
484
// in block scoping mode, only process 'let'; in non-block scoping
488
485
// mode, only process non-'let'
489
486
if (blockscope == nd .isBlockScoped (ecmaVersion )) visit (nd .getDeclarations ());
@@ -518,8 +515,7 @@ public Void visit(ClassBody nd, Void c) {
518
515
@ Override
519
516
public Void visit (NamespaceDeclaration nd , Void c ) {
520
517
if (blockscope ) return null ;
521
- boolean isAmbientOutsideDtsFile = nd .hasDeclareKeyword () && !isInTypeScriptDeclarationFile ();
522
- boolean hasVariable = nd .isInstantiated () && !isAmbientOutsideDtsFile ;
518
+ boolean hasVariable = nd .isInstantiated ();
523
519
visit (nd .getName (), hasVariable ? DeclKind .varAndNamespace : DeclKind .namespace );
524
520
return null ;
525
521
}
0 commit comments