From a6ed2c84ac65f68dc6cf102dffb44f3b00fd0277 Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Wed, 8 May 2013 16:22:39 +0300 Subject: Better fix for equality of typeof ... against "undefined" --- test/compress/issue-105.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'test/compress') diff --git a/test/compress/issue-105.js b/test/compress/issue-105.js index 0c37eb82..ca17adbf 100644 --- a/test/compress/issue-105.js +++ b/test/compress/issue-105.js @@ -3,7 +3,7 @@ typeof_eq_undefined: { comparisons: true }; input: { a = typeof b.c != "undefined" } - expect: { a = typeof b.c != "undefined" } + expect: { a = "undefined" != typeof b.c } } typeof_eq_undefined_unsafe: { @@ -12,5 +12,14 @@ typeof_eq_undefined_unsafe: { unsafe: true }; input: { a = typeof b.c != "undefined" } - expect: { a = b.c !== void 0 } + expect: { a = void 0 !== b.c } +} + +typeof_eq_undefined_unsafe2: { + options = { + comparisons: true, + unsafe: true + }; + input: { a = "undefined" != typeof b.c } + expect: { a = void 0 !== b.c } } -- cgit v1.2.3