diff options
author | Mihai Bazon <mihai@bazon.net> | 2013-05-08 16:22:39 +0300 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2013-05-08 16:22:48 +0300 |
commit | a6ed2c84ac65f68dc6cf102dffb44f3b00fd0277 (patch) | |
tree | 45d365d3f4cce1f6c5fa7785670fd005dd0a0b8f /test/compress | |
parent | a1958aad563030b76bf4d9af7bf80a160c625e27 (diff) | |
download | tracifyjs-a6ed2c84ac65f68dc6cf102dffb44f3b00fd0277.tar.gz tracifyjs-a6ed2c84ac65f68dc6cf102dffb44f3b00fd0277.zip |
Better fix for equality of typeof ... against "undefined"
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/issue-105.js | 13 |
1 files changed, 11 insertions, 2 deletions
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 } } |