fix AST_Scope.clone() (#2803)

fixes #2799
This commit is contained in:
Alex Lam S.L
2018-01-17 21:33:13 +08:00
committed by GitHub
parent d3ce2bc9e7
commit 07e4b64f3a
3 changed files with 72 additions and 0 deletions

View File

@@ -308,6 +308,13 @@ var AST_Scope = DEFNODE("Scope", "variables functions uses_with uses_eval parent
enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes",
cname: "[integer/S] current index for mangling variables (used internally by the mangler)",
},
clone: function(deep) {
var node = this._clone(deep);
if (this.variables) node.variables = this.variables.clone();
if (this.functions) node.functions = this.functions.clone();
if (this.enclosed) node.enclosed = this.enclosed.slice();
return node;
}
}, AST_Block);
var AST_Toplevel = DEFNODE("Toplevel", "globals", {