summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/DataView/prototype/getBigUint64/negative-byteoffset-throws.js
blob: de50598408b28dd8a379b944b602478e2c828127 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// 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 RangeError if getIndex < 0
features: [DataView, ArrayBuffer, BigInt, arrow-function]
---*/

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

assert.throws(RangeError, () => sample.getBigUint64(-1),
  "DataView access at index -1 should throw");

assert.throws(RangeError, () => sample.getBigUint64(-Infinity),
  "DataView access at index -Infinity should throw");

reportCompare(0, 0);