From cf1fda3e4f260fca76e3a85c9d3e6ff20bc53a61 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 24 Aug 2020 16:29:03 +0200 Subject: [PATCH] refactor: fix older edge dev builds Co-authored-by: BenoitRanque --- src/warning.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/warning.ts b/src/warning.ts index 58ad5549..b42f5200 100644 --- a/src/warning.ts +++ b/src/warning.ts @@ -1,3 +1,9 @@ -export function warn(msg: string, ...args: any[]) { - console.warn('[Vue Router warn]: ' + msg, ...args) +export function warn(msg: string, ..._args: any[]): void +export function warn(msg: string): void { + // avoid using ...args as it breaks in older Edge builds + const args = Array.from(arguments).slice(1) + console.warn.apply( + console, + ['[Vue Router warn]: ' + msg].concat(args) as [string, ...any[]] + ) } -- 2.47.2