diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/jit-test/tests/debug/Frame-asyncPromise-02.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Frame-asyncPromise-02.js b/js/src/jit-test/tests/debug/Frame-asyncPromise-02.js new file mode 100644 index 0000000000..c65d13f9c5 --- /dev/null +++ b/js/src/jit-test/tests/debug/Frame-asyncPromise-02.js @@ -0,0 +1,26 @@ +// Test the promise property on normal function frames. + +load(libdir + 'asserts.js'); + +var g = newGlobal({ newCompartment: true }); +var dbg = Debugger(g); +g.eval(` +function f() { + debugger; +} +`); + +let frame; +const promises = []; +dbg.onDebuggerStatement = function(f) { + frame = f; + promises.push(frame.asyncPromise); +}; + +const resultPromise = g.f(); + +// Frame has terminated, so accessing the property throws. +assertThrowsInstanceOf(() => frame.asyncPromise, Error); + +assertEq(promises.length, 1); +assertEq(promises[0], undefined); |