Update to latest jsonld.js.
authorDave Longley <dlongley@digitalbazaar.com>
Tue, 16 Jul 2013 15:21:26 -0400
changeset 1765 f97908287e5d
parent 1764 aa82137eef3d
child 1766 e1e400c332d5
child 1770 dfd4c4831ba5
Update to latest jsonld.js.
playground/jsonld.js
--- a/playground/jsonld.js	Tue Jul 16 15:10:24 2013 -0400
+++ b/playground/jsonld.js	Tue Jul 16 15:21:26 2013 -0400
@@ -292,12 +292,12 @@
       remoteContext: {'@context': remoteDoc.contextUrl}
     };
     if('expandContext' in options) {
-      if(typeof options.expandContext === 'object' &&
-        '@context' in options.expandContext) {
-        input.expandContext = _clone(options.expandContext);
+      var expandContext = _clone(options.expandContext);
+      if(typeof expandContext === 'object' && '@context' in expandContext) {
+        input.expandContext = expandContext;
       }
       else {
-        input.expandContext = {'@context': options.expandContext};
+        input.expandContext = {'@context': expandContext};
       }
     }
     _retrieveContextUrls(input, options, function(err, input) {
@@ -314,7 +314,7 @@
         // process optional expandContext
         if(input.expandContext) {
           activeCtx = processor.processContext(
-            activeCtx, input.expandContext, options);
+            activeCtx, input.expandContext['@context'], options);
         }
 
         // process remote context from HTTP Link Header