summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/TypedObject/bug1082649.js
blob: bf21d3859bf10042b216434ef773e3da716830d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
if (typeof TypedObject === "undefined")
  quit();

var {StructType, uint32, storage} = TypedObject;
var S = new StructType({f: uint32, g: uint32});
function main() {
  var s = new S({f: 22, g: 44});
  detachArrayBuffer(storage(s).buffer);
  print(storage(s).byteOffset);
}
try {
    main();
    assertEq(true, false);
} catch (e) {
    assertEq(e instanceof TypeError, true);
}