diegoles / closure-library

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

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

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 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