fix corner case in keep_fnames
happens when inner function: - just below top level - not referenced - `unused` is disabled closes #1445
This commit is contained in:
@@ -268,12 +268,12 @@ AST_SymbolRef.DEFMETHOD("reference", function(options) {
|
||||
var s = this.scope;
|
||||
while (s) {
|
||||
push_uniq(s.enclosed, def);
|
||||
if (s === def.scope) break;
|
||||
if (options.keep_fnames) {
|
||||
s.variables.each(function(d) {
|
||||
s.functions.each(function(d) {
|
||||
push_uniq(def.scope.enclosed, d);
|
||||
});
|
||||
}
|
||||
if (s === def.scope) break;
|
||||
s = s.parent_scope;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user