mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Local declarations don't mutate captured outer variables
This commit is contained in:
@@ -1393,7 +1393,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
|
||||
function createFlowMutation(flags: FlowFlags.Assignment | FlowFlags.ArrayMutation, antecedent: FlowNode, node: Expression | VariableDeclaration | ArrayBindingElement) {
|
||||
setFlowNodeReferenced(antecedent);
|
||||
hasFlowEffects = true;
|
||||
hasFlowMutation = true;
|
||||
if (node.kind !== SyntaxKind.VariableDeclaration && node.kind !== SyntaxKind.BindingElement) hasFlowMutation = true;
|
||||
const result = createFlowNode(flags, node, antecedent) as FlowAssignment | FlowArrayMutation;
|
||||
if (currentExceptionTarget) {
|
||||
addAntecedent(currentExceptionTarget, result);
|
||||
|
||||
Reference in New Issue
Block a user