ÿØÿà JFIF ÿÛ „ ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /home/real/node-v13.0.1/test/fixtures/wpt/html/webappapis/microtask-queuing/ |
// META: global=window,worker "use strict"; test(() => { assert_equals(typeof queueMicrotask, "function"); }, "It exists and is a function"); test(() => { assert_throws(new TypeError(), () => queueMicrotask(), "no argument"); assert_throws(new TypeError(), () => queueMicrotask(undefined), "undefined"); assert_throws(new TypeError(), () => queueMicrotask(null), "null"); assert_throws(new TypeError(), () => queueMicrotask(0), "0"); assert_throws(new TypeError(), () => queueMicrotask({ handleEvent() { } }), "an event handler object"); assert_throws(new TypeError(), () => queueMicrotask("window.x = 5;"), "a string"); }, "It throws when given non-functions"); async_test(t => { let called = false; queueMicrotask(t.step_func_done(() => { called = true; })); assert_false(called); }, "It calls the callback asynchronously"); async_test(t => { queueMicrotask(t.step_func_done(function () { // note: intentionally not an arrow function assert_array_equals(arguments, []); }), "x", "y"); }, "It does not pass any arguments"); async_test(t => { const happenings = []; Promise.resolve().then(() => happenings.push("a")); queueMicrotask(() => happenings.push("b")); Promise.reject().catch(() => happenings.push("c")); queueMicrotask(t.step_func_done(() => { assert_array_equals(happenings, ["a", "b", "c"]); })); }, "It interleaves with promises as expected");