aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2013-01-23 23:52:04 -0500
committerRichard Gibson <richard.gibson@gmail.com>2013-01-23 23:52:04 -0500
commit522566ea80011dc1674ca7f10a5666a24f24ac27 (patch)
treeb383de96e268ebebfa9b6d660687aee168b77ba9 /test/compress
parent297af47c891006cb2f5b98e3c8675af1e00d15a6 (diff)
downloadtracifyjs-522566ea80011dc1674ca7f10a5666a24f24ac27.tar.gz
tracifyjs-522566ea80011dc1674ca7f10a5666a24f24ac27.zip
Fix #105: property comparison to undefined is not always safe
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/issue-105.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/compress/issue-105.js b/test/compress/issue-105.js
new file mode 100644
index 00000000..349d732d
--- /dev/null
+++ b/test/compress/issue-105.js
@@ -0,0 +1,17 @@
+typeof_eq_undefined: {
+ options = {
+ comparisons: true,
+ unsafe: false
+ };
+ input: { a = typeof b.c != "undefined" }
+ expect: { a = "undefined" != typeof b.c }
+}
+
+typeof_eq_undefined_unsafe: {
+ options = {
+ comparisons: true,
+ unsafe: true
+ };
+ input: { a = typeof b.c != "undefined" }
+ expect: { a = b.c !== void 0 }
+}