Merge branch 'master' into harmony-v2.8.11

This commit is contained in:
alexlamsl
2017-03-10 11:17:49 +08:00
8 changed files with 239 additions and 34 deletions

View File

@@ -278,9 +278,10 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
self.walk(new TreeWalker(function(node, descend) {
if (node instanceof AST_SymbolCatch) {
var name = node.name;
var refs = node.thedef.references;
var scope = node.thedef.scope.parent_scope;
var def = scope.find_variable(name) || self.globals.get(name) || scope.def_variable(node);
node.thedef.references.forEach(function(ref) {
refs.forEach(function(ref) {
ref.thedef = def;
ref.reference(options);
});