amis-rpc-design/node_modules/core-js/modules/web.queue-microtask.js
2023-10-07 19:42:30 +08:00

21 lines
763 B
JavaScript

'use strict';
var $ = require('../internals/export');
var global = require('../internals/global');
var microtask = require('../internals/microtask');
var aCallable = require('../internals/a-callable');
var validateArgumentsLength = require('../internals/validate-arguments-length');
var IS_NODE = require('../internals/engine-is-node');
var process = global.process;
// `queueMicrotask` method
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask
$({ global: true, enumerable: true, dontCallGetSet: true }, {
queueMicrotask: function queueMicrotask(fn) {
validateArgumentsLength(arguments.length, 1);
aCallable(fn);
var domain = IS_NODE && process.domain;
microtask(domain ? domain.bind(fn) : fn);
}
});