fix corner case in inline (#4660)

fixes #4659
This commit is contained in:
Alex Lam S.L
2021-02-18 08:15:44 +00:00
committed by GitHub
parent 6a2bda52f3
commit a7bcd4d613
3 changed files with 133 additions and 9 deletions

View File

@@ -433,7 +433,9 @@ AST_Symbol.DEFMETHOD("mark_enclosed", function(options) {
var def = this.definition();
for (var s = this.scope; s; s = s.parent_scope) {
push_uniq(s.enclosed, def);
if (options.keep_fnames) {
if (!options) {
delete s._var_names;
} else if (options.keep_fnames) {
s.functions.each(function(d) {
push_uniq(def.scope.enclosed, d);
});