@@ -85,7 +85,7 @@ function convertToHashbangUrl(url, basePath, hashPrefix) {
8585 path = match . path . substr ( pathPrefix . length ) ;
8686
8787 if ( match . path . indexOf ( pathPrefix ) !== 0 ) {
88- throw 'Invalid url "' + url + '", missing path prefix "' + pathPrefix + '" !' ;
88+ throw Error ( 'Invalid url "' + url + '", missing path prefix "' + pathPrefix + '" !' ) ;
8989 }
9090
9191 return composeProtocolHostPort ( match . protocol , match . host , match . port ) + basePath +
@@ -114,7 +114,7 @@ function LocationUrl(url, pathPrefix) {
114114 var match = matchUrl ( url , this ) ;
115115
116116 if ( match . path . indexOf ( pathPrefix ) !== 0 ) {
117- throw 'Invalid url "' + url + '", missing path prefix "' + pathPrefix + '" !' ;
117+ throw Error ( 'Invalid url "' + url + '", missing path prefix "' + pathPrefix + '" !' ) ;
118118 }
119119
120120 this . $$path = decodeURIComponent ( match . path . substr ( pathPrefix . length ) ) ;
@@ -160,8 +160,9 @@ function LocationHashbangUrl(url, hashPrefix) {
160160 this . $$parse = function ( url ) {
161161 var match = matchUrl ( url , this ) ;
162162
163+
163164 if ( match . hash && match . hash . indexOf ( hashPrefix ) !== 0 ) {
164- throw 'Invalid url "' + url + '", missing hash prefix "' + hashPrefix + '" !' ;
165+ throw Error ( 'Invalid url "' + url + '", missing hash prefix "' + hashPrefix + '" !' ) ;
165166 }
166167
167168 basePath = match . path + ( match . search ? '?' + match . search : '' ) ;
0 commit comments