Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aOrz committed Mar 23, 2018
1 parent 846719f commit fae0866
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/core/util/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,23 @@ export const nextTick = (function () {
// "force" the microtask queue to be flushed by adding an empty timer.
if (isIOS) setTimeout(noop)
}
} else if (typeof MutationObserver !== 'undefined' && (
isNative(MutationObserver) ||
// PhantomJS and iOS 7.x
MutationObserver.toString() === '[object MutationObserverConstructor]'
)) {
// use MutationObserver where native Promise is not available,
// e.g. PhantomJS IE11, iOS7, Android 4.4
var counter = 1
var observer = new MutationObserver(nextTickHandler)
var textNode = document.createTextNode(String(counter))
observer.observe(textNode, {
characterData: true
})
timerFunc = () => {
counter = (counter + 1) % 2
textNode.data = String(counter)
}
// } else if (typeof MutationObserver !== 'undefined' && (
// isNative(MutationObserver) ||
// // PhantomJS and iOS 7.x
// MutationObserver.toString() === '[object MutationObserverConstructor]'
// )) {
// // use MutationObserver where native Promise is not available,
// // e.g. PhantomJS IE11, iOS7, Android 4.4
// var counter = 1
// var observer = new MutationObserver(nextTickHandler)
// var textNode = document.createTextNode(String(counter))
// observer.observe(textNode, {
// characterData: true
// })
// timerFunc = () => {
// counter = (counter + 1) % 2
// textNode.data = String(counter)
// }
} else {
// fallback to setTimeout
/* istanbul ignore next */
Expand Down

0 comments on commit fae0866

Please sign in to comment.