Browse Source

refactor: reduce if-else nesting, coalesce conditions (#9060)

dev
Joseph Anglada 6 years ago
committed by Evan You
parent
commit
1129d18448
  1. 14
      src/core/instance/render.js

14
src/core/instance/render.js

@ -86,15 +86,11 @@ export function renderMixin (Vue: Class<Component>) {
// return error render result,
// or previous vnode to prevent render error causing blank component
/* istanbul ignore else */
if (process.env.NODE_ENV !== 'production') {
if (vm.$options.renderError) {
try {
vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e)
} catch (e) {
handleError(e, vm, `renderError`)
vnode = vm._vnode
}
} else {
if (process.env.NODE_ENV !== 'production' && vm.$options.renderError) {
try {
vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e)
} catch (e) {
handleError(e, vm, `renderError`)
vnode = vm._vnode
}
} else {

Loading…
Cancel
Save