fix typeof side effects (#1696)

`statement_to_expression()` drops `typeof` even if it operates on undeclared variables.

Since we now have `drop_side_effect_free()`, replace and remove this deprecated functionality.
This commit is contained in:
Alex Lam S.L
2017-03-27 04:37:42 +08:00
committed by GitHub
parent f5952933a0
commit 581630e0a7
3 changed files with 30 additions and 24 deletions

View File

@@ -353,8 +353,9 @@ issue_1254_negate_iife_nested: {
issue_1288: {
options = {
negate_iife: true,
conditionals: true,
negate_iife: true,
side_effects: false,
};
input: {
if (w) ;
@@ -374,11 +375,11 @@ issue_1288: {
})(0);
}
expect: {
w || function f() {}();
x || function() {
w || !function f() {}();
x || !function() {
x = {};
}();
y ? function() {}() : function(z) {
y ? !function() {}() : !function(z) {
return z;
}(0);
}