parent
caaa753861
commit
c7d2837184
|
|
@ -12998,6 +12998,7 @@ Compressor.prototype.compress = function(node) {
|
||||||
});
|
});
|
||||||
scope = scope.parent_scope;
|
scope = scope.parent_scope;
|
||||||
}
|
}
|
||||||
|
if (!member(scope, compressor.stack)) return;
|
||||||
if (scope instanceof AST_Toplevel && fn.variables.size() > (arrow ? 0 : 1)) {
|
if (scope instanceof AST_Toplevel && fn.variables.size() > (arrow ? 0 : 1)) {
|
||||||
if (!compressor.toplevel.vars) return;
|
if (!compressor.toplevel.vars) return;
|
||||||
if (fn.functions.size() > 0 && !compressor.toplevel.funcs) return;
|
if (fn.functions.size() > 0 && !compressor.toplevel.funcs) return;
|
||||||
|
|
|
||||||
|
|
@ -7977,3 +7977,40 @@ issue_5264_2: {
|
||||||
"baz",
|
"baz",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5283: {
|
||||||
|
options = {
|
||||||
|
if_return: true,
|
||||||
|
inline: true,
|
||||||
|
pure_getters: "strict",
|
||||||
|
side_effects: true,
|
||||||
|
unused: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = "FAIL 1";
|
||||||
|
(function() {
|
||||||
|
(a = "PASS")[function() {
|
||||||
|
if (console)
|
||||||
|
return null;
|
||||||
|
var b = function f(a) {
|
||||||
|
console.log("FAIL 2");
|
||||||
|
var c = a.p;
|
||||||
|
}();
|
||||||
|
}()];
|
||||||
|
})();
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = "FAIL 1";
|
||||||
|
(function() {
|
||||||
|
a = "PASS";
|
||||||
|
if (!console)
|
||||||
|
(function(a) {
|
||||||
|
console.log("FAIL 2");
|
||||||
|
a.p;
|
||||||
|
})();
|
||||||
|
})();
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user