diff --git a/lib/scope.js b/lib/scope.js index cd480841..40237b39 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -226,6 +226,7 @@ AST_SymbolRef.DEFMETHOD("reference", function() { var s = this.scope; while (s) { push_uniq(s.enclosed, def); + if (s === def.scope) break; s = s.parent_scope; } });