Skip to content

Commit acd92cf

Browse files
yaodingydyyx990803
authored andcommitted
chore: unify the terms 'microtask' and '(macro) task' (#7641)
1 parent b2092db commit acd92cf

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/core/util/next-tick.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ function flushCallbacks () {
1717
}
1818
}
1919

20-
// Here we have async deferring wrappers using both micro and macro tasks.
21-
// In < 2.4 we used micro tasks everywhere, but there are some scenarios where
22-
// micro tasks have too high a priority and fires in between supposedly
20+
// Here we have async deferring wrappers using both microtasks and (macro) tasks.
21+
// In < 2.4 we used microtasks everywhere, but there are some scenarios where
22+
// microtasks have too high a priority and fire in between supposedly
2323
// sequential events (e.g. #4521, #6690) or even between bubbling of the same
24-
// event (#6566). However, using macro tasks everywhere also has subtle problems
24+
// event (#6566). However, using (macro) tasks everywhere also has subtle problems
2525
// when state is changed right before repaint (e.g. #6813, out-in transitions).
26-
// Here we use micro task by default, but expose a way to force macro task when
26+
// Here we use microtask by default, but expose a way to force (macro) task when
2727
// needed (e.g. in event handlers attached by v-on).
2828
let microTimerFunc
2929
let macroTimerFunc
3030
let useMacroTask = false
3131

32-
// Determine (macro) Task defer implementation.
32+
// Determine (macro) task defer implementation.
3333
// Technically setImmediate should be the ideal choice, but it's only available
3434
// in IE. The only polyfill that consistently queues the callback after all DOM
3535
// events triggered in the same loop is by using MessageChannel.
@@ -56,7 +56,7 @@ if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
5656
}
5757
}
5858

59-
// Determine MicroTask defer implementation.
59+
// Determine microtask defer implementation.
6060
/* istanbul ignore next, $flow-disable-line */
6161
if (typeof Promise !== 'undefined' && isNative(Promise)) {
6262
const p = Promise.resolve()
@@ -76,7 +76,7 @@ if (typeof Promise !== 'undefined' && isNative(Promise)) {
7676

7777
/**
7878
* Wrap a function so that if any code inside triggers state change,
79-
* the changes are queued using a Task instead of a MicroTask.
79+
* the changes are queued using a (macro) task instead of a microtask.
8080
*/
8181
export function withMacroTask (fn: Function): Function {
8282
return fn._withTask || (fn._withTask = function () {

0 commit comments

Comments
 (0)