From 0febc0500328b691927bbea86b61055dd61c5549 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Tue, 1 Sep 2020 10:19:26 +0200 Subject: [PATCH] chore: todos --- __tests__/utils.ts | 2 +- src/matcher/index.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/__tests__/utils.ts b/__tests__/utils.ts index ef1c3717..b51ddbdf 100644 --- a/__tests__/utils.ts +++ b/__tests__/utils.ts @@ -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 diff --git a/src/matcher/index.ts b/src/matcher/index.ts index 268e285e..ce957513 100644 --- a/src/matcher/index.ts +++ b/src/matcher/index.ts @@ -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 } -- 2.47.2