Switch node null/not null tests don't always work

a === null / a !=== null

is different to

    typeof a == "undefined" / typeof a != "undefined"
This commit is contained in:
Nicholas O'Leary 2013-12-03 01:10:25 +00:00
parent 7eae669a34
commit 5767478871
1 changed files with 2 additions and 2 deletions

View File

@ -28,8 +28,8 @@ var operators = {
'regex': function(a, b) { return (a + "").match(new RegExp(b)); },
'true': function(a) { return a === true; },
'false': function(a) { return a === false; },
'null': function(a) { return a === null; },
'nnull': function(a) { return a !== null; },
'null': function(a) { return typeof a == "undefined"; },
'nnull': function(a) { return typeof a != "undefined"; },
'else': function(a) { return a === true; }
};