2017-05-28 00:38:50 +02:00
|
|
|
// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask
|
2017-08-14 05:01:11 +02:00
|
|
|
var $export = require('./_export');
|
|
|
|
var microtask = require('./_microtask')();
|
|
|
|
var process = require('./_global').process;
|
|
|
|
var isNode = require('./_cof')(process) == 'process';
|
2017-05-28 00:38:50 +02:00
|
|
|
|
|
|
|
$export($export.G, {
|
2017-08-14 05:01:11 +02:00
|
|
|
asap: function asap(fn) {
|
2017-05-28 00:38:50 +02:00
|
|
|
var domain = isNode && process.domain;
|
|
|
|
microtask(domain ? domain.bind(fn) : fn);
|
|
|
|
}
|
2017-08-14 05:01:11 +02:00
|
|
|
});
|