// 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;
}
expect: {
var a = "FAIL";
- a && (a = "PASS");
+ !function(b) {
+ b && (a = "PASS");
+ }(a);
console.log(a);
}
expect_stdout: "PASS"
function f0(bar) {
(function() {
(function() {
- if (false <= NaN & this >> 1 >= 0)
+ if (false <= 0/0 & this >> 1 >= 0)
c++;
})(c++);
})();
options = {
keep_fargs: false,
loops: true,
- passes: 2,
reduce_vars: true,
unused: true,
}
dead_code: true,
evaluate: true,
loops: true,
+ passes: 2,
side_effects: true,
unused: true,
}
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"
}
}
expect: {
(function() {
- (function() {
+ (function(c) {
try {
- (void 0).p = 0;
+ c.p = 0;
} catch (e) {
console.log("PASS");
return;
}
- })();
+ })(void 0);
})();
}
expect_stdout: "PASS"
"// }",
]).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";',
"",