diff options
Diffstat (limited to 'js/src/jit-test/tests/ctypes/conversion-error.js')
-rw-r--r-- | js/src/jit-test/tests/ctypes/conversion-error.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ctypes/conversion-error.js b/js/src/jit-test/tests/ctypes/conversion-error.js new file mode 100644 index 000000000..a6823fe5c --- /dev/null +++ b/js/src/jit-test/tests/ctypes/conversion-error.js @@ -0,0 +1,14 @@ +load(libdir + 'asserts.js'); + +function test() { + let obj = { + toSource() { + throw 1; + } + }; + assertTypeErrorMessage(() => { ctypes.double().value = obj; }, + "can't convert <<error converting value to string>> to the type double"); +} + +if (typeof ctypes === "object") + test(); |