Update to latest jsonld.js.
--- a/playground/jsonld.js Thu Feb 28 16:43:13 2013 -0500
+++ b/playground/jsonld.js Thu Feb 28 16:51:40 2013 -0500
@@ -4495,28 +4495,31 @@
return e !== '.' && (e !== '' || i === segments.length - 1);
});
- // remove as many '..' as possible
- for(var i = 0; i < segments.length;) {
- var segment = segments[i];
- if(segment === '..') {
- // too many reverse dots
- if(i === 0) {
- var last = segments[segments.length - 1];
- if(last !== '..') {
- segments = [last];
+ // do not remove '..' for empty base
+ if(base.href !== '') {
+ // remove as many '..' as possible
+ for(var i = 0; i < segments.length;) {
+ var segment = segments[i];
+ if(segment === '..') {
+ // too many reverse dots
+ if(i === 0) {
+ var last = segments[segments.length - 1];
+ if(last !== '..') {
+ segments = [last];
+ }
+ else {
+ segments = [];
+ }
+ break;
}
- else {
- segments = [];
- }
- break;
- }
-
- // remove '..' and previous segment
- segments.splice(i - 1, 2);
- i -= 1;
- }
- else {
- i += 1;
+
+ // remove '..' and previous segment
+ segments.splice(i - 1, 2);
+ i -= 1;
+ }
+ else {
+ i += 1;
+ }
}
}