]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
refactor: fix older edge dev builds
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 24 Aug 2020 14:29:03 +0000 (16:29 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 24 Aug 2020 14:29:03 +0000 (16:29 +0200)
Co-authored-by: BenoitRanque <ranque.benoit@gmail.com>
src/warning.ts

index 58ad55494c24e17c1b8b66ac765ae31c49eff50b..b42f520039aa11af5691049fed73baed6df7cd55 100644 (file)
@@ -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[]]
+  )
 }