Updated to latest jsonld.js.
authorDave Longley <dlongley@digitalbazaar.com>
Wed, 02 May 2012 13:55:35 -0400
changeset 612 c2d91c94c863
parent 611 f5082cc1e77e
child 614 5259a1abcf03
Updated to latest jsonld.js.
playground/jsonld.js
--- a/playground/jsonld.js	Tue May 01 16:34:07 2012 -0400
+++ b/playground/jsonld.js	Wed May 02 13:55:35 2012 -0400
@@ -3593,7 +3593,7 @@
  * @return true if the value is an Object, false if not.
  */
 function _isObject(v) {
-  return (v !== null && !_isUndefined(v) && v.constructor === Object);
+  return (Object.prototype.toString.call(v) === '[object Object]');
 }
 
 /**
@@ -3615,7 +3615,7 @@
  * @return true if the value is an Array, false if not.
  */
 function _isArray(v) {
-  return (v !== null && !_isUndefined(v) && v.constructor === Array);
+  return Array.isArray(v);
 }
 
 /**
@@ -3658,7 +3658,8 @@
  * @return true if the value is a String, false if not.
  */
 function _isString(v) {
-  return (v !== null && !_isUndefined(v) && v.constructor === String);
+  return (typeof v === 'string' ||
+    Object.prototype.toString.call(v) === '[object String]');
 }
 
 /**
@@ -3669,7 +3670,8 @@
  * @return true if the value is a Number, false if not.
  */
 function _isNumber(v) {
-  return (v !== null && !_isUndefined(v) && v.constructor === Number);
+  return (typeof v === 'number' ||
+    Object.prototype.toString.call(v) === '[object Number]');
 }
 
 /**
@@ -3691,7 +3693,8 @@
  * @return true if the value is a Boolean, false if not.
  */
 function _isBoolean(v) {
-  return (v !== null && !_isUndefined(v) && v.constructor === Boolean);
+  return (typeof v === 'boolean' ||
+    Object.prototype.toString.call(v) === '[object Boolean]');
 }
 
 /**