Update to latest jsonld.js.
authorDave Longley <dlongley@digitalbazaar.com>
Thu, 19 Sep 2013 16:42:31 -0400
changeset 2000 bd3fb281aecc
parent 1999 e87980e7c416
child 2001 ee76096809db
Update to latest jsonld.js.
playground/jsonld.js
--- a/playground/jsonld.js	Thu Sep 19 16:42:02 2013 -0400
+++ b/playground/jsonld.js	Thu Sep 19 16:42:31 2013 -0400
@@ -1209,7 +1209,7 @@
   if(!(key1 in this.cache)) {
     this.cache[key1] = {};
   }
-  this.cache[key1][key2] = result;
+  this.cache[key1][key2] = _clone(result);
 };
 
 /**
@@ -3464,12 +3464,14 @@
   var rval = {'@value': o.value};
 
   // add language
-  if('language' in o) {
+  if(o['language']) {
     rval['@language'] = o.language;
   }
-  // add datatype
   else {
     var type = o.datatype;
+    if(!type) {
+      type = XSD_STRING;
+    }
     // use native types for certain xsd types
     if(useNativeTypes) {
       if(type === XSD_BOOLEAN) {