unnecessarily strict {in,}equality in existence checks

This commit is contained in:
Michael Ficarra
2011-03-29 17:25:09 -04:00
parent 3d3b03e1e4
commit 31ae260282
3 changed files with 7 additions and 7 deletions

View File

@@ -1419,9 +1419,9 @@ exports.Existence = class Existence extends Base
code = @expression.compile o, LEVEL_OP
code = if IDENTIFIER.test(code) and not o.scope.check code
if @negated
"typeof #{code} == \"undefined\" || #{code} === null"
"typeof #{code} == \"undefined\" || #{code} == null"
else
"typeof #{code} != \"undefined\" && #{code} !== null"
"typeof #{code} != \"undefined\" && #{code} != null"
else
sym = if @negated then '==' else '!='
"#{code} #{sym} null"