Debian Codegraph @

js/src/jit-test/tests/ctypes/conversion-int64.js

raw
1 load(libdir + 'asserts.js');
2
3 function test() {
4 assertRangeErrorMessage(() => { ctypes.Int64("0xfffffffffffffffffffffff"); },
5 "the string \"0xfffffffffffffffffffffff\" does not fit in the type int64");
6 assertTypeErrorMessage(() => { ctypes.Int64.join("foo", 0); },
7 "can't pass the string \"foo\" to argument 1 of Int64.join");
8 assertTypeErrorMessage(() => { ctypes.Int64.join(0, "foo"); },
9 "can't pass the string \"foo\" to argument 2 of Int64.join");
10
11 assertRangeErrorMessage(() => { ctypes.UInt64("0xfffffffffffffffffffffff"); },
12 "the string \"0xfffffffffffffffffffffff\" does not fit in the type uint64");
13 assertTypeErrorMessage(() => { ctypes.UInt64.join("foo", 0); },
14 "can't pass the string \"foo\" to argument 1 of UInt64.join");
15 assertTypeErrorMessage(() => { ctypes.UInt64.join(0, "foo"); },
16 "can't pass the string \"foo\" to argument 2 of UInt64.join");
17 }
18
19 if (typeof ctypes === "object")
20 test();