Browse Source

setTimeout fallback update (#3868)

* - update setTimeout fallback
- reset cachedWrite.cacheBuffer with .length = 0 for better efficient

* update style

* revert cacheBuffer

* update to arrow function
dev
defcc 8 years ago
committed by Evan You
parent
commit
f59e903d0b
  1. 6
      src/core/util/env.js

6
src/core/util/env.js

@ -81,7 +81,9 @@ export const nextTick = (function () {
} else {
// fallback to setTimeout
/* istanbul ignore next */
timerFunc = setTimeout
timerFunc = () => {
setTimeout(nextTickHandler, 0)
}
}
return function queueNextTick (cb: Function, ctx?: Object) {
@ -91,7 +93,7 @@ export const nextTick = (function () {
callbacks.push(func)
if (!pending) {
pending = true
timerFunc(nextTickHandler, 0)
timerFunc()
}
}
})()

Loading…
Cancel
Save