From 1129d184482720bb52fa61f0a309645b7caaddd9 Mon Sep 17 00:00:00 2001 From: Joseph Anglada Date: Sat, 1 Dec 2018 00:57:26 -0400 Subject: [PATCH] refactor: reduce if-else nesting, coalesce conditions (#9060) --- src/core/instance/render.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/core/instance/render.js b/src/core/instance/render.js index 70fb2c0e..be12d726 100644 --- a/src/core/instance/render.js +++ b/src/core/instance/render.js @@ -86,15 +86,11 @@ export function renderMixin (Vue: Class) { // 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 {