diff --git a/uris.js b/uris.js index b3a7831..32e0335 100644 --- a/uris.js +++ b/uris.js @@ -122,7 +122,7 @@ removeDotSegments: function( input ) { var output = ''; var q = null; - while( input.length > 0 ) { + while( input.toString().length > 0 ) { if( input.substr(0,3) == '../' || input.substr(0,2) == './' ) { input = input.slice(input.indexOf('/')); } else if( input == '/.' ) { @@ -227,7 +227,7 @@ q = this.heirpart().authority(); T.authority = q ? '//' + q : ''; } - T.scheme = this.scheme(); + T.scheme = this.scheme() || ''; } q = reference.fragment(); T.fragment = q ? q : ''; @@ -272,7 +272,7 @@ path: function() { var q = this.authority(); if( !q ) return new URI.Path(this); - return new URI.Path( this.slice(q.length + 2) ); + return new URI.Path( this.slice(q.toString().length + 2) ); } };