@@ -501,49 +501,53 @@ export function bindSourceFile(file: SourceFile, options: CompilerOptions) {
501
501
}
502
502
503
503
function createBinder ( ) : ( file : SourceFile , options : CompilerOptions ) => void {
504
- let file : SourceFile ;
505
- let options : CompilerOptions ;
506
- let languageVersion : ScriptTarget ;
507
- let parent : Node ;
508
- let container : IsContainer | EntityNameExpression ;
509
- let thisParentContainer : IsContainer | EntityNameExpression ; // Container one level up
510
- let blockScopeContainer : IsBlockScopedContainer ;
511
- let lastContainer : HasLocals ;
512
- let delayedTypeAliases : ( JSDocTypedefTag | JSDocCallbackTag | JSDocEnumTag ) [ ] ;
513
- let seenThisKeyword : boolean ;
504
+ /* eslint-disable no-var */
505
+ var file : SourceFile ;
506
+ var options : CompilerOptions ;
507
+ var languageVersion : ScriptTarget ;
508
+ var parent : Node ;
509
+ var container : IsContainer | EntityNameExpression ;
510
+ var thisParentContainer : IsContainer | EntityNameExpression ; // Container one level up
511
+ var blockScopeContainer : IsBlockScopedContainer ;
512
+ var lastContainer : HasLocals ;
513
+ var delayedTypeAliases : ( JSDocTypedefTag | JSDocCallbackTag | JSDocEnumTag ) [ ] ;
514
+ var seenThisKeyword : boolean ;
514
515
515
516
// state used by control flow analysis
516
- let currentFlow : FlowNode ;
517
- let currentBreakTarget : FlowLabel | undefined ;
518
- let currentContinueTarget : FlowLabel | undefined ;
519
- let currentReturnTarget : FlowLabel | undefined ;
520
- let currentTrueTarget : FlowLabel | undefined ;
521
- let currentFalseTarget : FlowLabel | undefined ;
522
- let currentExceptionTarget : FlowLabel | undefined ;
523
- let preSwitchCaseFlow : FlowNode | undefined ;
524
- let activeLabelList : ActiveLabel | undefined ;
525
- let hasExplicitReturn : boolean ;
517
+ var currentFlow : FlowNode ;
518
+ var currentBreakTarget : FlowLabel | undefined ;
519
+ var currentContinueTarget : FlowLabel | undefined ;
520
+ var currentReturnTarget : FlowLabel | undefined ;
521
+ var currentTrueTarget : FlowLabel | undefined ;
522
+ var currentFalseTarget : FlowLabel | undefined ;
523
+ var currentExceptionTarget : FlowLabel | undefined ;
524
+ var preSwitchCaseFlow : FlowNode | undefined ;
525
+ var activeLabelList : ActiveLabel | undefined ;
526
+ var hasExplicitReturn : boolean ;
526
527
527
528
// state used for emit helpers
528
- let emitFlags : NodeFlags ;
529
+ var emitFlags : NodeFlags ;
529
530
530
531
// If this file is an external module, then it is automatically in strict-mode according to
531
532
// ES6. If it is not an external module, then we'll determine if it is in strict mode or
532
533
// not depending on if we see "use strict" in certain places or if we hit a class/namespace
533
534
// or if compiler options contain alwaysStrict.
534
- let inStrictMode : boolean ;
535
+ var inStrictMode : boolean ;
535
536
536
537
// If we are binding an assignment pattern, we will bind certain expressions differently.
537
- let inAssignmentPattern = false ;
538
+ var inAssignmentPattern = false ;
538
539
539
- let symbolCount = 0 ;
540
+ var symbolCount = 0 ;
540
541
541
- let Symbol : new ( flags : SymbolFlags , name : __String ) => Symbol ;
542
- let classifiableNames : Set < __String > ;
542
+ var Symbol : new ( flags : SymbolFlags , name : __String ) => Symbol ;
543
+ var classifiableNames : Set < __String > ;
543
544
544
- const unreachableFlow : FlowNode = { flags : FlowFlags . Unreachable } ;
545
- const reportedUnreachableFlow : FlowNode = { flags : FlowFlags . Unreachable } ;
546
- const bindBinaryExpressionFlow = createBindBinaryExpressionFlow ( ) ;
545
+ var unreachableFlow : FlowNode = { flags : FlowFlags . Unreachable } ;
546
+ var reportedUnreachableFlow : FlowNode = { flags : FlowFlags . Unreachable } ;
547
+ var bindBinaryExpressionFlow = createBindBinaryExpressionFlow ( ) ;
548
+ /* eslint-enable no-var */
549
+
550
+ return bindSourceFile ;
547
551
548
552
/**
549
553
* Inside the binder, we may create a diagnostic for an as-yet unbound node (with potentially no parent pointers, implying no accessible source file)
@@ -600,8 +604,6 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
600
604
emitFlags = NodeFlags . None ;
601
605
}
602
606
603
- return bindSourceFile ;
604
-
605
607
function bindInStrictMode ( file : SourceFile , opts : CompilerOptions ) : boolean {
606
608
if ( getStrictOptionValue ( opts , "alwaysStrict" ) && ! file . isDeclarationFile ) {
607
609
// bind in strict mode source files with alwaysStrict option
0 commit comments