Fix handling of labels in nested scopes

This commit is contained in:
Mihai Bazon
2013-01-04 14:17:33 +02:00
parent 130c623be7
commit 6b14f7c224

View 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