summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/promise/no-reentrant-drainjobqueue.js
blob: 7db07bdc73eea720718b5d9a58441c5b0a27e2f2 (plain)
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);