jooking / closure-library

Automatically exported from code.google.com/p/closure-library
Apache License 2.0
0 stars 1 forks source link

goog.Uri,removeDotSegments returns wrong results for leading ../ #506

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
asertEquals('../a.js', goog.Uri.removeDotSegments('../a.js'))

The .. case needs to updated to:

        } else if (segment == '..') {
          if (out.length > 1 || out.length == 1 && out[0] != '') {
            out.pop();
          } else if (leadingSlash && pos == segments.length) {
            out.push('');
          } else {
            out.push(segment);
          }

I haven't run the tests so maybe this is incomplete or breaks something else

Original issue reported on code.google.com by arv@google.com on 12 Oct 2012 at 3:51