|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 | var $ = require('../internals/export');
|
|---|
| 3 | var globalThis = require('../internals/global-this');
|
|---|
| 4 | var microtask = require('../internals/microtask');
|
|---|
| 5 | var aCallable = require('../internals/a-callable');
|
|---|
| 6 | var validateArgumentsLength = require('../internals/validate-arguments-length');
|
|---|
| 7 | var fails = require('../internals/fails');
|
|---|
| 8 | var DESCRIPTORS = require('../internals/descriptors');
|
|---|
| 9 |
|
|---|
| 10 | // Bun ~ 1.0.30 bug
|
|---|
| 11 | // https://github.com/oven-sh/bun/issues/9249
|
|---|
| 12 | var WRONG_ARITY = fails(function () {
|
|---|
| 13 | // getOwnPropertyDescriptor for prevent experimental warning in Node 11
|
|---|
| 14 | // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|---|
| 15 | return DESCRIPTORS && Object.getOwnPropertyDescriptor(globalThis, 'queueMicrotask').value.length !== 1;
|
|---|
| 16 | });
|
|---|
| 17 |
|
|---|
| 18 | // `queueMicrotask` method
|
|---|
| 19 | // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask
|
|---|
| 20 | $({ global: true, enumerable: true, dontCallGetSet: true, forced: WRONG_ARITY }, {
|
|---|
| 21 | queueMicrotask: function queueMicrotask(fn) {
|
|---|
| 22 | validateArgumentsLength(arguments.length, 1);
|
|---|
| 23 | microtask(aCallable(fn));
|
|---|
| 24 | }
|
|---|
| 25 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.