diff options
Diffstat (limited to 'js/src/jit-test/tests/debug/isError.js')
-rw-r--r-- | js/src/jit-test/tests/debug/isError.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/isError.js b/js/src/jit-test/tests/debug/isError.js new file mode 100644 index 0000000000..253d2c76d4 --- /dev/null +++ b/js/src/jit-test/tests/debug/isError.js @@ -0,0 +1,19 @@ +let g = newGlobal({newCompartment: true}); +let dbg = new Debugger(); +let gw = dbg.addDebuggee(g); + +g.error1 = new Error() +g.error2 = new g.Error() +g.error3 = new g.TypeError(); + +let error1DO = gw.getOwnPropertyDescriptor('error1').value; +let error2DO = gw.getOwnPropertyDescriptor('error2').value; +let error3DO = gw.getOwnPropertyDescriptor('error3').value; + +assertEq(error1DO.isError, true); +assertEq(error2DO.isError, true); +assertEq(error3DO.isError, true); + +g.nonError = new Array(); +let nonErrorDO = gw.getOwnPropertyDescriptor('nonError').value; +assertEq(nonErrorDO.isError, false); |