diff --git a/src/core/util/next-tick.js b/src/core/util/next-tick.js index 07a9e84184..cc066ed86f 100644 --- a/src/core/util/next-tick.js +++ b/src/core/util/next-tick.js @@ -81,9 +81,11 @@ if (typeof Promise !== 'undefined' && isNative(Promise)) { export function withMacroTask (fn: Function): Function { return fn._withTask || (fn._withTask = function () { useMacroTask = true - const res = fn.apply(null, arguments) - useMacroTask = false - return res + try { + return fn.apply(null, arguments) + } finally { + useMacroTask = false + } }) }