diff options
Diffstat (limited to 'js/src/jit-test/tests/ctypes/argument-length-primitive.js')
-rw-r--r-- | js/src/jit-test/tests/ctypes/argument-length-primitive.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ctypes/argument-length-primitive.js b/js/src/jit-test/tests/ctypes/argument-length-primitive.js new file mode 100644 index 000000000..161ebd880 --- /dev/null +++ b/js/src/jit-test/tests/ctypes/argument-length-primitive.js @@ -0,0 +1,11 @@ +load(libdir + 'asserts.js'); + +function test() { + assertTypeErrorMessage(() => { ctypes.int32_t(1, 2, 3); }, + "CType constructor takes at most one argument"); + assertTypeErrorMessage(() => { ctypes.int32_t.array(1, 2); }, + "CType.prototype.array takes at most one argument"); +} + +if (typeof ctypes === "object") + test(); |