diff options
Diffstat (limited to 'js/src/jit-test/tests/promise/no-reentrant-drainjobqueue.js')
-rw-r--r-- | js/src/jit-test/tests/promise/no-reentrant-drainjobqueue.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/promise/no-reentrant-drainjobqueue.js b/js/src/jit-test/tests/promise/no-reentrant-drainjobqueue.js new file mode 100644 index 000000000..7db07bdc7 --- /dev/null +++ b/js/src/jit-test/tests/promise/no-reentrant-drainjobqueue.js @@ -0,0 +1,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); |