@@ -7003,6 +7003,8 @@ merge(Compressor.prototype, {
|
||||
// always shallow clone to ensure stripping of negated IIFEs
|
||||
self = self.clone();
|
||||
self.expression = exp.clone();
|
||||
// avoid extraneous traversal
|
||||
if (exp._squeezed) self.expression._squeezed = true;
|
||||
}
|
||||
if (self instanceof AST_New) {
|
||||
var fn = exp;
|
||||
|
||||
@@ -3322,7 +3322,9 @@ issue_3506_1: {
|
||||
}
|
||||
expect: {
|
||||
var a = "FAIL";
|
||||
a && (a = "PASS");
|
||||
!function(b) {
|
||||
b && (a = "PASS");
|
||||
}(a);
|
||||
console.log(a);
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
|
||||
@@ -438,7 +438,7 @@ issue_2506: {
|
||||
function f0(bar) {
|
||||
(function() {
|
||||
(function() {
|
||||
if (false <= NaN & this >> 1 >= 0)
|
||||
if (false <= 0/0 & this >> 1 >= 0)
|
||||
c++;
|
||||
})(c++);
|
||||
})();
|
||||
|
||||
@@ -1067,7 +1067,6 @@ issue_4084: {
|
||||
options = {
|
||||
keep_fargs: false,
|
||||
loops: true,
|
||||
passes: 2,
|
||||
reduce_vars: true,
|
||||
unused: true,
|
||||
}
|
||||
@@ -1276,6 +1275,7 @@ issue_4355: {
|
||||
dead_code: true,
|
||||
evaluate: true,
|
||||
loops: true,
|
||||
passes: 2,
|
||||
side_effects: true,
|
||||
unused: true,
|
||||
}
|
||||
|
||||
@@ -673,27 +673,21 @@ issue_4575: {
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
A = "PASS";
|
||||
(function() {
|
||||
var a = 0, b = a;
|
||||
var c = function a(...b) {
|
||||
A;
|
||||
var d = A;
|
||||
console.log(d, b.length);
|
||||
(function(a) {
|
||||
var b = a;
|
||||
var c = function a(...d) {
|
||||
console.log(d.length);
|
||||
}();
|
||||
})();
|
||||
}
|
||||
expect: {
|
||||
A = "PASS";
|
||||
(function() {
|
||||
(function(b) {
|
||||
A;
|
||||
var d = A;
|
||||
console.log(d, b.length);
|
||||
})([]);
|
||||
(function(a) {
|
||||
(function a(...d) {
|
||||
console.log(d.length);
|
||||
})();
|
||||
})();
|
||||
}
|
||||
expect_stdout: "PASS 0"
|
||||
expect_stdout: "0"
|
||||
node_version: ">=6"
|
||||
}
|
||||
|
||||
|
||||
@@ -458,14 +458,14 @@ issue_4325: {
|
||||
}
|
||||
expect: {
|
||||
(function() {
|
||||
(function() {
|
||||
(function(c) {
|
||||
try {
|
||||
(void 0).p = 0;
|
||||
c.p = 0;
|
||||
} catch (e) {
|
||||
console.log("PASS");
|
||||
return;
|
||||
}
|
||||
})();
|
||||
})(void 0);
|
||||
})();
|
||||
}
|
||||
expect_stdout: "PASS"
|
||||
|
||||
@@ -294,8 +294,9 @@ describe("test/reduce.js", function() {
|
||||
"// }",
|
||||
]).join("\n"));
|
||||
});
|
||||
it("Should maintain block-scope for const & let", function() {
|
||||
it("Should maintain block-scope for const/let", function() {
|
||||
if (semver.satisfies(process.version, "<4")) return;
|
||||
this.timeout(120000);
|
||||
var code = [
|
||||
'"use strict";',
|
||||
"",
|
||||
|
||||
Reference in New Issue
Block a user