Debian Codegraph @

js/src/jit-test/tests/promise/unhandled-rejections-different-realm.js

raw
1 // |jit-test| error:Unhandled rejection: "some reason"
2
3 // Test JS shell's unhandled rejection tracking.
4
5 var z = newGlobal();
6
7 Promise.prototype.then = z.Promise.prototype.then;
8
9 // Add unhandled rejection from other realm.
10 evalcx("var p = (async function() { throw 'some reason' })()", z);
11
12 // Add unhandled rejection from this realm.
13 var p = (async function f() { throw 'other reason'; })();
14
15 // Remove unhandled rejection from this realm.
16 p.then();
17
18 // Remove unhandled rejection from other realm.
19 evalcx("p.then()", z);