aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2013-01-04 14:17:33 +0200
committerMihai Bazon <mihai@bazon.net>2013-01-04 14:17:33 +0200
commit6b14f7c224852a8b7b7cb837935bc300482d4d46 (patch)
tree62e4744b9d8d35269e3f1a6342e43ba6d14d3dd5
parent130c623be74ea010b11222d43eb23a181d36cd8a (diff)
downloadtracifyjs-6b14f7c224852a8b7b7cb837935bc300482d4d46.tar.gz
tracifyjs-6b14f7c224852a8b7b7cb837935bc300482d4d46.zip
Fix handling of labels in nested scopes
-rw-r--r--lib/scope.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/scope.js b/lib/scope.js
index 34ca5fb3..7bcd372f 100644
--- a/lib/scope.js
+++ b/lib/scope.js
@@ -84,9 +84,12 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(){
if (node instanceof AST_Scope) {
node.init_scope_vars(nesting);
var save_scope = node.parent_scope = scope;
+ var save_labels = labels;
++nesting;
scope = node;
+ labels = new Dictionary();
descend();
+ labels = save_labels;
scope = save_scope;
--nesting;
return true; // don't descend again in TreeWalker