summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/DataView/prototype/getBigUint64/detached-buffer.js
blob: a0cbfa37609f05ce29c64e9abed4497f29451b85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright (C) 2017 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-dataview.prototype.getbiguint64
description: >
  Throws a TypeError if buffer is detached
includes: [detachArrayBuffer.js]
features: [DataView, ArrayBuffer, BigInt, arrow-function]
---*/

var buffer = new ArrayBuffer(1);
var sample = new DataView(buffer, 0);

$DETACHBUFFER(buffer);
assert.throws(TypeError, () => sample.getBigUint64(0),
  "detached DataView access should throw");

reportCompare(0, 0);