diff options
Diffstat (limited to 'js/src/jit-test/tests/ctypes/argument-length-cdata.js')
-rw-r--r-- | js/src/jit-test/tests/ctypes/argument-length-cdata.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ctypes/argument-length-cdata.js b/js/src/jit-test/tests/ctypes/argument-length-cdata.js new file mode 100644 index 000000000..56a1497f4 --- /dev/null +++ b/js/src/jit-test/tests/ctypes/argument-length-cdata.js @@ -0,0 +1,15 @@ +load(libdir + 'asserts.js'); + +function test() { + assertTypeErrorMessage(() => { ctypes.int32_t(0).address(1); }, + "CData.prototype.address takes no arguments"); + assertTypeErrorMessage(() => { ctypes.char.array(10)().readString(1); }, + "CData.prototype.readString takes no arguments"); + assertTypeErrorMessage(() => { ctypes.char.array(10)().readStringReplaceMalformed(1); }, + "CData.prototype.readStringReplaceMalformed takes no arguments"); + assertTypeErrorMessage(() => { ctypes.int32_t(0).toSource(1); }, + "CData.prototype.toSource takes no arguments"); +} + +if (typeof ctypes === "object") + test(); |