1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

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

View File

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