bug1814020.js (768B)
1 const dbg = newGlobal({ sameZoneAs: this }).Debugger(this); 2 3 async function* inspectingGenerator() { 4 await undefined; 5 6 const frame = dbg.getNewestFrame(); 7 const asyncPromise = frame.asyncPromise; 8 assertEq(asyncPromise.getPromiseReactions().length, 0); 9 } 10 11 async function* emptyGenerator() {} 12 13 const gen = inspectingGenerator(); 14 const inspectingGenPromise = gen.next(); 15 16 const emptyGen = emptyGenerator(); 17 // Close generator. 18 emptyGen.next(); 19 20 // Creates a reaction record on the inspectingGenPromise which points to the 21 // closed emptyGen generator. 22 emptyGen.return(inspectingGenPromise); 23 24 // Execute the inspectingGenerator() code after `await`, which gets the 25 // promise reactions (potentially including the closed emptyGen generator) 26 drainJobQueue();