Browse Source

fix coverage

Evan You 9 years ago
parent
commit
e468ba078e
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/core/util/env.js

+ 6 - 2
src/core/util/env.js

@@ -61,9 +61,13 @@ 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)) {
+  } 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. IE11, iOS7, Android 4.4
+    // e.g. PhantomJS IE11, iOS7, Android 4.4
     var counter = 1
     var observer = new MutationObserver(nextTickHandler)
     var textNode = document.createTextNode(String(counter))