// You can verify this test is correct by copy pasting this into a browser's console and checking it doesn't throw an error. var run = 0; var queueMicrotask = process.nextTick; await new Promise((resolve, reject) => { queueMicrotask(() => { if (run++ != 0) { reject(new Error("Microtask execution order is wrong: " + run)); } queueMicrotask(() => { if (run++ != 3) { reject(new Error("Microtask execution order is wrong: " + run)); } }); }); queueMicrotask(() => { if (run++ != 1) { reject(new Error("Microtask execution order is wrong: " + run)); } queueMicrotask(() => { if (run++ != 4) { reject(new Error("Microtask execution order is wrong: " + run)); } queueMicrotask(() => { if (run++ != 6) { reject(new Error("Microtask execution order is wrong: " + run)); } }); }); }); queueMicrotask(() => { if (run++ != 2) { reject(new Error("Microtask execution order is wrong: " + run)); } queueMicrotask(() => { if (run++ != 5) { reject(new Error("Microtask execution order is wrong: " + run)); } queueMicrotask(() => { if (run++ != 7) { reject(new Error("Microtask execution order is wrong: " + run)); } resolve(true); }); }); }); }); { var passed = false; try { queueMicrotask(1234); } catch (exception) { passed = exception instanceof TypeError; } if (!passed) throw new Error( "queueMicrotask should throw a TypeError if the argument is not a function" ); } { var passed = false; try { queueMicrotask(); } catch (exception) { passed = exception instanceof TypeError; } if (!passed) throw new Error( "queueMicrotask should throw a TypeError if the argument is empty" ); } await new Promise((resolve, reject) => { process.nextTick( (first, second) => { console.log(first, second); if (first !== 12345 || second !== "hello") reject(new Error("process.nextTick called with wrong arguments")); resolve(true); }, 12345, "hello" ); }); -valid Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/ZigGeneratedCode.cpp (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2023-02-13fix(FormData): make String explicit, thanks @dylan-conway (#2065)Gravatar Derrick Farris 1-1/+1
2023-02-13fix(FormData): add string literal operator (#2064)Gravatar Derrick Farris 1-2/+2
2023-02-13Add pretty printer for FormDataGravatar Jarred Sumner 5-1/+101
2023-02-13Add dynamic port assigning to Bun.serve (#2062)Gravatar MichaƂ Warda 3-5/+40
2023-02-13feat(napi): add `napi_get_value_bigint_words` (#2061)Gravatar Derrick Farris 3-0/+44
2023-02-13Fixes https://github.com/oven-sh/bun/issues/1456Gravatar Jarred Sumner 8-1/+148