warn & drop #__PURE__ iff IIFE is dropped (#1511)
- consolidate `side-effects` optimisations - improve string `+` optimisation - enhance literal & `conditionals` optimisations
This commit is contained in:
@@ -29,6 +29,7 @@ typeof_in_boolean_context: {
|
||||
booleans : true,
|
||||
evaluate : true,
|
||||
conditionals : true,
|
||||
side_effects : true,
|
||||
};
|
||||
input: {
|
||||
function f1(x) { return typeof x ? "yes" : "no"; }
|
||||
@@ -36,12 +37,14 @@ typeof_in_boolean_context: {
|
||||
typeof 0 ? foo() : bar();
|
||||
!typeof console.log(1);
|
||||
var a = !typeof console.log(2);
|
||||
if (typeof (1 + foo()));
|
||||
}
|
||||
expect: {
|
||||
function f1(x) { return "yes"; }
|
||||
function f2() { return g(), "Yes"; }
|
||||
foo();
|
||||
!(console.log(1), !0);
|
||||
console.log(1);
|
||||
var a = !(console.log(2), !0);
|
||||
foo();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user