From 8cd27bca2f51f5ed208a9cba35e0abd232befa9e Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 29 May 2012 12:12:54 +0200 Subject: [PATCH] 'null' and 'undefined' are primitives, too --- source/Ox/js/Type.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/Ox/js/Type.js b/source/Ox/js/Type.js index 651136ea..aee84d20 100644 --- a/source/Ox/js/Type.js +++ b/source/Ox/js/Type.js @@ -272,8 +272,9 @@ Ox.isPrimitive Tests if a value is a primitive (boolean, number or string) false @*/ Ox.isPrimitive = function(value) { - var type = Ox.typeOf(value); - return type == 'boolean' || type == 'number' || type == 'string'; + return Ox.contains( + ['boolean', 'null', 'number', 'string', 'undefined'], Ox.typeOf(value) + ); }; /*@