Fix handling of labels in nested scopes
authorMihai Bazon <mihai@bazon.net>
Fri, 4 Jan 2013 12:17:33 +0000 (14:17 +0200)
committerMihai Bazon <mihai@bazon.net>
Fri, 4 Jan 2013 12:17:33 +0000 (14:17 +0200)
lib/scope.js

index 34ca5fb..7bcd372 100644 (file)
@@ -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