Update to latest jsonld.js.
authorDave Longley <dlongley@digitalbazaar.com>
Tue, 16 Apr 2013 10:16:27 -0400
changeset 1593 3feaeb852c3c
parent 1592 a641c749c3e6
child 1594 6d9cd0b72a4e
Update to latest jsonld.js.
playground/jsonld.js
--- a/playground/jsonld.js	Mon Apr 15 13:41:53 2013 -0400
+++ b/playground/jsonld.js	Tue Apr 16 10:16:27 2013 -0400
@@ -4175,7 +4175,7 @@
   }
 
   // create new mapping
-  var mapping = {};
+  var mapping = activeCtx.mappings[term] = {};
   mapping.reverse = false;
 
   if('@reverse' in value) {
@@ -4245,6 +4245,9 @@
     }
   }
 
+  // IRI mapping now defined
+  defined[term] = true;
+
   if('@type' in value) {
     var type = value['@type'];
     if(!_isString(type)) {
@@ -4306,10 +4309,6 @@
       'Invalid JSON-LD syntax; @context and @preserve cannot be aliased.',
       'jsonld.SyntaxError');
   }
-
-  // define term mapping
-  activeCtx.mappings[term] = mapping;
-  defined[term] = true;
 }
 
 /**