| | |
| | | var global = require('../internals/global'); |
| | | var bind = require('../internals/function-bind-context'); |
| | | var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; |
| | | var macrotask = require('../internals/task').set; |
| | | var IS_IOS = require('../internals/engine-is-ios'); |
| | |
| | | promise = Promise.resolve(undefined); |
| | | // workaround of WebKit ~ iOS Safari 10.1 bug |
| | | promise.constructor = Promise; |
| | | then = promise.then; |
| | | then = bind(promise.then, promise); |
| | | notify = function () { |
| | | then.call(promise, flush); |
| | | then(flush); |
| | | }; |
| | | // Node.js without promises |
| | | } else if (IS_NODE) { |
| | |
| | | // for other environments - macrotask based on: |
| | | // - setImmediate |
| | | // - MessageChannel |
| | | // - window.postMessag |
| | | // - window.postMessage |
| | | // - onreadystatechange |
| | | // - setTimeout |
| | | } else { |
| | | // strange IE + webpack dev server bug - use .bind(global) |
| | | macrotask = bind(macrotask, global); |
| | | notify = function () { |
| | | // strange IE + webpack dev server bug - use .call(global) |
| | | macrotask.call(global, flush); |
| | | macrotask(flush); |
| | | }; |
| | | } |
| | | } |