aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/library/modules/es7.asap.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/core-js/library/modules/es7.asap.js')
-rw-r--r--node_modules/core-js/library/modules/es7.asap.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/node_modules/core-js/library/modules/es7.asap.js b/node_modules/core-js/library/modules/es7.asap.js
new file mode 100644
index 00000000..d36f7c76
--- /dev/null
+++ b/node_modules/core-js/library/modules/es7.asap.js
@@ -0,0 +1,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);
+ }
+});