1 2 3 4 5 6 7 8 9 10
let thenCalled = false; let p1 = new Promise(res => res('result')).then(val => { Promise.resolve(1).then(_=>{thenCalled = true;}); // This reentrant call is ignored. drainJobQueue(); assertEq(thenCalled, false); }); drainJobQueue(); assertEq(thenCalled, true);