Update to latest jsonld.js.
authorDave Longley <dlongley@digitalbazaar.com>
Mon, 11 Mar 2013 20:54:55 -0400
changeset 1418 a138136d0e38
parent 1417 cb608c1ae36e
child 1419 bf937c4cdd3a
Update to latest jsonld.js.
playground/jsonld.js
--- a/playground/jsonld.js	Tue Mar 12 00:33:09 2013 +0100
+++ b/playground/jsonld.js	Mon Mar 11 20:54:55 2013 -0400
@@ -3241,16 +3241,16 @@
     }
 
     // handle reverse properties
-    if('@reverse' in input) {
+    if(property === '@reverse') {
       var referencedNode = {'@id': name};
       var reverseMap = input['@reverse'];
       for(var reverseProperty in reverseMap) {
         var items = reverseMap[reverseProperty];
-        for(var ii = 0; ii < items; ++ii) {
+        for(var ii = 0; ii < items.length; ++ii) {
           var item = items[ii];
           jsonld.addValue(
             item, reverseProperty, referencedNode,
-            {propertyIsArray: true});
+            {propertyIsArray: true, allowDuplicate: false});
           _createNodeMap(item, graphs, graph, namer);
         }
       }