From acd92cf981d384d4006c81b9001a6d35957630dc Mon Sep 17 00:00:00 2001 From: Yao Ding Date: Thu, 8 Mar 2018 11:58:14 -0500 Subject: [PATCH] chore: unify the terms 'microtask' and '(macro) task' (#7641) --- src/core/util/next-tick.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/util/next-tick.js b/src/core/util/next-tick.js index 9e4f476d65b..07a9e841843 100644 --- a/src/core/util/next-tick.js +++ b/src/core/util/next-tick.js @@ -17,19 +17,19 @@ function flushCallbacks () { } } -// Here we have async deferring wrappers using both micro and macro tasks. -// In < 2.4 we used micro tasks everywhere, but there are some scenarios where -// micro tasks have too high a priority and fires in between supposedly +// Here we have async deferring wrappers using both microtasks and (macro) tasks. +// In < 2.4 we used microtasks everywhere, but there are some scenarios where +// microtasks have too high a priority and fire in between supposedly // sequential events (e.g. #4521, #6690) or even between bubbling of the same -// event (#6566). However, using macro tasks everywhere also has subtle problems +// event (#6566). However, using (macro) tasks everywhere also has subtle problems // when state is changed right before repaint (e.g. #6813, out-in transitions). -// Here we use micro task by default, but expose a way to force macro task when +// Here we use microtask by default, but expose a way to force (macro) task when // needed (e.g. in event handlers attached by v-on). let microTimerFunc let macroTimerFunc let useMacroTask = false -// Determine (macro) Task defer implementation. +// Determine (macro) task defer implementation. // Technically setImmediate should be the ideal choice, but it's only available // in IE. The only polyfill that consistently queues the callback after all DOM // events triggered in the same loop is by using MessageChannel. @@ -56,7 +56,7 @@ if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { } } -// Determine MicroTask defer implementation. +// Determine microtask defer implementation. /* istanbul ignore next, $flow-disable-line */ if (typeof Promise !== 'undefined' && isNative(Promise)) { const p = Promise.resolve() @@ -76,7 +76,7 @@ if (typeof Promise !== 'undefined' && isNative(Promise)) { /** * Wrap a function so that if any code inside triggers state change, - * the changes are queued using a Task instead of a MicroTask. + * the changes are queued using a (macro) task instead of a microtask. */ export function withMacroTask (fn: Function): Function { return fn._withTask || (fn._withTask = function () {