You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
584 B
17 lines
584 B
4 years ago
|
var $ = require('../internals/export');
|
||
|
var global = require('../internals/global');
|
||
|
var microtask = require('../internals/microtask');
|
||
|
var classof = require('../internals/classof-raw');
|
||
|
|
||
|
var process = global.process;
|
||
|
var isNode = classof(process) == 'process';
|
||
|
|
||
|
// `queueMicrotask` method
|
||
|
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask
|
||
|
$({ global: true, enumerable: true, noTargetGet: true }, {
|
||
|
queueMicrotask: function queueMicrotask(fn) {
|
||
|
var domain = isNode && process.domain;
|
||
|
microtask(domain ? domain.bind(fn) : fn);
|
||
|
}
|
||
|
});
|