aboutsummaryrefslogtreecommitdiff
path: root/lib/ast.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ast.js')
-rw-r--r--lib/ast.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ast.js b/lib/ast.js
index b6d4ebb7..73f4696a 100644
--- a/lib/ast.js
+++ b/lib/ast.js
@@ -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;