aboutsummaryrefslogtreecommitdiff
path: root/node_modules/babel-runtime/node_modules/core-js/modules/es7.asap.js
blob: d36f7c76087965b39f5d192d51a73199e224b3f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask
var $export = require('./_export');
var microtask = require('./_microtask')();
var process = require('./_global').process;
var isNode = require('./_cof')(process) == 'process';

$export($export.G, {
  asap: function asap(fn) {
    var domain = isNode && process.domain;
    microtask(domain ? domain.bind(fn) : fn);
  }
});