Fix #105: property comparison to undefined is not always safe

This commit is contained in:
Richard Gibson
2013-01-23 23:52:04 -05:00
parent 297af47c89
commit 522566ea80
2 changed files with 19 additions and 1 deletions

View File

@@ -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 }
}