1
0
Fork 0
firefox/testing/mochitest/tests/browser/browser_fail_uncaught_rejection.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

14 lines
451 B
JavaScript

setExpectedFailuresForSelfTest(2);
function test() {
Promise.reject(new Error("Promise rejection."));
(async () => {
throw new Error("Synchronous rejection from async function.");
})();
// The following rejections are caught, so they won't result in failures.
Promise.reject(new Error("Promise rejection.")).catch(() => {});
(async () => {
throw new Error("Synchronous rejection from async function.");
})().catch(() => {});
}