fix corner case in functions (#3365)

fixes #3364
This commit is contained in:
Alex Lam S.L
2019-04-18 17:03:52 +08:00
committed by GitHub
parent 21cd7e3f57
commit e8a2c0b5bf
3 changed files with 67 additions and 4 deletions

View File

@@ -61,8 +61,6 @@ SymbolDef.next_id = 1;
SymbolDef.prototype = {
unmangleable: function(options) {
if (!options) options = {};
return this.global && !options.toplevel
|| this.undeclared
|| !options.eval && this.scope.pinned()
@@ -296,7 +294,7 @@ AST_Scope.DEFMETHOD("def_variable", function(symbol, init) {
AST_Lambda.DEFMETHOD("resolve", return_this);
AST_Scope.DEFMETHOD("resolve", function() {
return this.parent_scope;
return this.parent_scope.resolve();
});
AST_Toplevel.DEFMETHOD("resolve", return_this);