Update to latest jsonld.js.
authorDave Longley <dlongley@digitalbazaar.com>
Fri, 21 Feb 2014 12:24:41 -0500
changeset 2108 7d3932389077
parent 2107 df9b79289d65
child 2109 73ca80504f8d
child 2111 17ce0687cb69
Update to latest jsonld.js.
playground/jsonld.js
--- a/playground/jsonld.js	Fri Feb 21 10:24:20 2014 +0100
+++ b/playground/jsonld.js	Fri Feb 21 12:24:41 2014 -0500
@@ -5230,11 +5230,9 @@
   // use '../' for each non-matching base segment
   var rval = '';
   if(baseSegments.length > 0) {
-    // don't count the last segment if it isn't a path (doesn't end in '/')
-    // don't count empty first segment, it means base began with '/'
-    if(base.normalizedPath.substr(-1) !== '/' || baseSegments[0] === '') {
-      baseSegments.pop();
-    }
+    // don't count the last segment (if it ends with '/' last path doesn't
+    // count and if it doesn't end with '/' it isn't a path)
+    baseSegments.pop();
     for(var i = 0; i < baseSegments.length; ++i) {
       rval += '../';
     }