Skip to content

Commit 423f215

Browse files
committed
util.warn: add stack trace using Vue.config.debug
1 parent 7244199 commit 423f215

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/directives/view.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ export default function (Vue) {
3939
this.keepAlive = false
4040
warn('<router-view> does not support keep-alive.')
4141
}
42-
/* istanbul ignore if */
43-
if (this.waitForEvent) {
44-
this.waitForEvent = null
45-
warn(
46-
'<router-view> does not support wait-for. Use ' +
47-
'the acitvate route hook instead.'
48-
)
49-
}
5042

5143
// all we need to do here is registering this view
5244
// in the router. actual component switching will be

src/util.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ export default exports
99
* Warn stuff.
1010
*
1111
* @param {String} msg
12-
* @param {Error} [err]
1312
*/
1413

15-
export function warn (msg, err) {
14+
export function warn (msg) {
1615
/* istanbul ignore next */
1716
if (window.console) {
1817
console.warn('[vue-router] ' + msg)
19-
if (err) {
20-
console.warn(err.stack)
18+
/* istanbul ignore if */
19+
if (!exports.Vue || exports.Vue.config.debug) {
20+
console.warn(new Error('warning stack trace:').stack)
2121
}
2222
}
2323
}

0 commit comments

Comments
 (0)