File tree Expand file tree Collapse file tree 4 files changed +10
-12
lines changed
test/unit/features/global-api Expand file tree Collapse file tree 4 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -60,18 +60,14 @@ export function renderMixin (Vue: Class<Component>) {
6060 try {
6161 vnode = render . call ( vm . _renderProxy , vm . $createElement )
6262 } catch ( e ) {
63- if ( process . env . NODE_ENV !== 'production' ) {
64- warn ( `Error when rendering ${ formatComponentName ( vm ) } :` )
65- }
6663 /* istanbul ignore else */
6764 if ( config . errorHandler ) {
6865 config . errorHandler . call ( null , e , vm )
6966 } else {
70- if ( isServerRendering ( ) ) {
71- throw e
72- } else {
73- console . error ( e )
67+ if ( process . env . NODE_ENV !== 'production' ) {
68+ warn ( `Error when rendering ${ formatComponentName ( vm ) } :` )
7469 }
70+ throw e
7571 }
7672 // return previous vnode to prevent render error causing blank component
7773 vnode = vm . _vnode
Original file line number Diff line number Diff line change @@ -166,14 +166,14 @@ export default class Watcher {
166166 try {
167167 this . cb . call ( this . vm , value , oldValue )
168168 } catch ( e ) {
169- process . env . NODE_ENV !== 'production' && warn (
170- `Error in watcher "${ this . expression } "` ,
171- this . vm
172- )
173169 /* istanbul ignore else */
174170 if ( config . errorHandler ) {
175171 config . errorHandler . call ( null , e , this . vm )
176172 } else {
173+ process . env . NODE_ENV !== 'production' && warn (
174+ `Error in watcher "${ this . expression } "` ,
175+ this . vm
176+ )
177177 throw e
178178 }
179179 }
Original file line number Diff line number Diff line change @@ -66,8 +66,9 @@ export const nextTick = (function () {
6666 /* istanbul ignore if */
6767 if ( typeof Promise !== 'undefined' && isNative ( Promise ) ) {
6868 var p = Promise . resolve ( )
69+ var logError = err => { console . error ( err ) }
6970 timerFunc = ( ) => {
70- p . then ( nextTickHandler )
71+ p . then ( nextTickHandler ) . catch ( logError )
7172 // in problematic UIWebViews, Promise.then doesn't completely break, but
7273 // it can get stuck in a weird state where callbacks are pushed into the
7374 // microtask queue but the queue isn't being flushed, until the browser
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ describe('Global config', () => {
3939 Vue . config . errorHandler = spy
4040 const err = new Error ( )
4141 const vm = new Vue ( {
42+ render ( ) { } ,
4243 data : { a : 1 } ,
4344 watch : {
4445 a : ( ) => {
You can’t perform that action at this time.
0 commit comments