File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,8 @@ namespace ts {
227227 const reportedUnreachableFlow : FlowNode = { flags : FlowFlags . Unreachable } ;
228228 const bindBinaryExpressionFlow = createBindBinaryExpressionFlow ( ) ;
229229
230+ const alreadyBound = new Set < Node > ( ) ;
231+
230232 /**
231233 * Inside the binder, we may create a diagnostic for an as-yet unbound node (with potentially no parent pointers, implying no accessible source file)
232234 * If so, the node _must_ be in the current file (as that's the only way anything could have traversed to it to yield it as the error node)
@@ -280,6 +282,7 @@ namespace ts {
280282 hasExplicitReturn = false ;
281283 inAssignmentPattern = false ;
282284 emitFlags = NodeFlags . None ;
285+ alreadyBound . clear ( ) ;
283286 }
284287
285288 return bindSourceFile ;
@@ -2373,6 +2376,10 @@ namespace ts {
23732376 if ( ! node ) {
23742377 return ;
23752378 }
2379+
2380+ Debug . assert ( ! alreadyBound . has ( node ) , "This node has already been bound." ) ;
2381+ alreadyBound . add ( node ) ;
2382+
23762383 setParent ( node , parent ) ;
23772384 if ( tracing ) ( node as TracingNode ) . tracingPath = file . path ;
23782385 const saveInStrictMode = inStrictMode ;
You can’t perform that action at this time.
0 commit comments