summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ctypes/AddressOfField.js
blob: 52f4d1cd175e786b27d82c6f3179bf84a094d0fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
load(libdir + 'asserts.js');

function test() {
  let strcut = ctypes.StructType("a", [ { "x": ctypes.int32_t, } ])();
  for (let arg of [1, undefined, null, false, {}, [], Symbol("foo")]) {
    assertThrowsInstanceOf(() => { struct.addressOfField(arg); },
                           Error);
  }
}

if (typeof ctypes === "object")
  test();