Debian Codegraph @

js/src/jit-test/tests/promise/unhandled-rejections-dead.js

raw
1 // |jit-test| error:Unhandled rejection
2
3 // Create the set object for unhandled rejection in this global.
4 async function fn() { e }
5 let p = fn();
6
7 var g = newGlobal();
8 g.evaluate(`
9 async function fn() { e }
10 fn()
11 // Create unhandled rejection in another compartment.
12 // The promise is tracked by the unhandled rejection set with CCW.
13 P = newGlobal().eval("(class extends Promise { function(){} })")
14
15 // Nuke the CCW to make the entry in unhandled rejection set a dead proxy.
16 Promise.all.call(P, [{ then() { nukeAllCCWs() } }])
17 `);