@@ -85,7 +85,7 @@ function convertToHashbangUrl(url, basePath, hashPrefix) {
85
85
path = match . path . substr ( pathPrefix . length ) ;
86
86
87
87
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 + '" !' ) ;
89
89
}
90
90
91
91
return composeProtocolHostPort ( match . protocol , match . host , match . port ) + basePath +
@@ -114,7 +114,7 @@ function LocationUrl(url, pathPrefix) {
114
114
var match = matchUrl ( url , this ) ;
115
115
116
116
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 + '" !' ) ;
118
118
}
119
119
120
120
this . $$path = decodeURIComponent ( match . path . substr ( pathPrefix . length ) ) ;
@@ -160,8 +160,9 @@ function LocationHashbangUrl(url, hashPrefix) {
160
160
this . $$parse = function ( url ) {
161
161
var match = matchUrl ( url , this ) ;
162
162
163
+
163
164
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 + '" !' ) ;
165
166
}
166
167
167
168
basePath = match . path + ( match . search ? '?' + match . search : '' ) ;
0 commit comments