From: Eduardo San Martin Morote Date: Tue, 1 Sep 2020 08:19:26 +0000 (+0200) Subject: chore: todos X-Git-Tag: v4.0.0-beta.8~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0febc0500328b691927bbea86b61055dd61c5549;p=thirdparty%2Fvuejs%2Frouter.git chore: todos --- 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 }