Skip to content

Commit f59e903

Browse files
defccyyx990803
authored andcommitted
setTimeout fallback update (#3868)
* - update setTimeout fallback - reset cachedWrite.cacheBuffer with .length = 0 for better efficient * update style * revert cacheBuffer * update to arrow function
1 parent 6643cb8 commit f59e903

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: src/core/util/env.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ export const nextTick = (function () {
8181
} else {
8282
// fallback to setTimeout
8383
/* istanbul ignore next */
84-
timerFunc = setTimeout
84+
timerFunc = () => {
85+
setTimeout(nextTickHandler, 0)
86+
}
8587
}
8688

8789
return function queueNextTick (cb: Function, ctx?: Object) {
@@ -91,7 +93,7 @@ export const nextTick = (function () {
9193
callbacks.push(func)
9294
if (!pending) {
9395
pending = true
94-
timerFunc(nextTickHandler, 0)
96+
timerFunc()
9597
}
9698
}
9799
})()

0 commit comments

Comments
 (0)