Debian Codegraph @

js/src/jit-test/tests/ctypes/AddressOfField.js

raw
1 load(libdir + 'asserts.js');
2
3 function test() {
4 let strcut = ctypes.StructType("a", [ { "x": ctypes.int32_t, } ])();
5 for (let arg of [1, undefined, null, false, {}, [], Symbol("foo")]) {
6 assertThrowsInstanceOf(() => { struct.addressOfField(arg); },
7 Error);
8 }
9 }
10
11 if (typeof ctypes === "object")
12 test();