]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
chore: todos
authorEduardo San Martin Morote <posva13@gmail.com>
Tue, 1 Sep 2020 08:19:26 +0000 (10:19 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Tue, 1 Sep 2020 08:19:26 +0000 (10:19 +0200)
__tests__/utils.ts
src/matcher/index.ts

index ef1c3717d69bd714cf3176aa010723d16ef80fb3..b51ddbdf2d647e786e1670f30447acc63a09ac91 100644 (file)
@@ -103,7 +103,7 @@ export function createDom(options?: ConstructorOptions) {
     }
   )
 
-  // @ts-ignore: TODO: remove this line then?
+  // @ts-ignore: needed for jsdom
   global.window = dom.window
   global.location = dom.window.location
   global.history = dom.window.history
index 268e285ebd2fb9eeab89d2e90cc34a1f46fc43fc..ce95751378d93996f49f133ca1d9fc47ad0cd101 100644 (file)
@@ -241,7 +241,7 @@ export function createRouterMatcher(
       // this also allows the user to control the encoding
       path = location.path
 
-      if (__DEV__ && path[0] !== '/') {
+      if (__DEV__ && !path.startsWith('/')) {
         warn(
           `The Matcher cannot resolve relative paths but received "${path}". Unless you directly called \`matcher.resolve("${path}")\`, this is probably a bug in vue-router. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-router-next.`
         )
@@ -252,6 +252,7 @@ export function createRouterMatcher(
 
       if (matcher) {
         // TODO: dev warning of unused params if provided
+        // we know the matcher works because we tested the regexp
         params = matcher.parse(path)!
         name = matcher.record.name
       }