Skip to content

Commit 90799e8

Browse files
committed
log expression errors directly
1 parent 76d6b78 commit 90799e8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/util/debug.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ function enableDebug () {
3030
* @param {String} msg
3131
*/
3232

33-
exports.warn = function (msg) {
33+
exports.warn = function (msg, e) {
3434
if (hasConsole && (!config.silent || config.debug)) {
3535
console.warn('[Vue warn]: ' + msg)
3636
/* istanbul ignore if */
3737
if (config.debug) {
3838
/* jshint debug: true */
39-
console.warn((new Error()).stack)
39+
console.warn((e || new Error()).stack)
4040
}
4141
}
4242
}

src/watcher.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ p.get = function () {
8080
if (config.warnExpressionErrors) {
8181
_.warn(
8282
'Error when evaluating expression "' +
83-
this.expression + '":\n ' + e
83+
this.expression + '"', e
8484
)
8585
}
8686
}
@@ -117,7 +117,7 @@ p.set = function (value) {
117117
if (config.warnExpressionErrors) {
118118
_.warn(
119119
'Error when evaluating setter "' +
120-
this.expression + '":\n ' + e
120+
this.expression + '"', e
121121
)
122122
}
123123
}

0 commit comments

Comments
 (0)