Update to latest jsonld.js.
authorDave Longley <dlongley@digitalbazaar.com>
Mon, 11 Mar 2013 16:51:40 -0400
changeset 1415 8ae8d9eb17d2
parent 1414 c80805153186
child 1416 1acef1c0dac5
Update to latest jsonld.js.
playground/jsonld.js
--- a/playground/jsonld.js	Mon Mar 11 16:50:47 2013 -0400
+++ b/playground/jsonld.js	Mon Mar 11 16:51:40 2013 -0400
@@ -3785,14 +3785,13 @@
   // preferences for the value of @type or @language
   var prefs = [];
 
-  // prefer @reverse first
-  if(typeOrLanguageValue === '@reverse') {
-    prefs.push('@reverse');
-  }
-
   // determine prefs for @id based on whether or not value compacts to a term
   if((typeOrLanguageValue === '@id' || typeOrLanguageValue === '@reverse') &&
     _isSubjectReference(value)) {
+    // prefer @reverse first
+    if(typeOrLanguageValue === '@reverse') {
+      prefs.push('@reverse');
+    }
     // try to compact value to a term
     var term = _compactIri(activeCtx, value['@id'], null, {vocab: true});
     if(term in activeCtx.mappings &&
@@ -3806,7 +3805,7 @@
       prefs.push.apply(prefs, ['@id', '@vocab']);
     }
   }
-  else if(typeOrLanguageValue !== '@reverse') {
+  else {
     prefs.push(typeOrLanguageValue);
   }
   prefs.push('@none');