fix corner case in sequences (#4073)

This commit is contained in:
Alex Lam S.L
2020-08-25 18:26:49 +01:00
committed by GitHub
parent a7e15fe73c
commit 09525c7530
3 changed files with 65 additions and 13 deletions

View File

@@ -288,10 +288,13 @@ var AST_LabeledStatement = DEFNODE("LabeledStatement", "label", {
var label = node.label;
var def = this.label;
node.walk(new TreeWalker(function(node) {
if (node instanceof AST_LoopControl && node.label && node.label.thedef === def) {
if (node instanceof AST_LoopControl) {
if (!node.label || node.label.thedef !== def) return;
node.label.thedef = label;
label.references.push(node);
return true;
}
if (node instanceof AST_Scope) return true;
}));
}
return node;