summaryrefslogtreecommitdiff
path: root/test/built-ins/DataView/prototype/getBigUint64/return-abrupt-from-tonumber-byteoffset.js
blob: 4f7bb959600d2e714be69642a3b8d3c3c78ce7bc (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: >
  Return abrupt from ToNumber(byteOffset)
features: [DataView, ArrayBuffer, BigInt, arrow-function]
---*/

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

var bo1 = { valueOf() { throw new Test262Error(); } };
var bo2 = { toString() { throw new Test262Error(); } };

assert.throws(Test262Error, () => sample.getBigUint64(bo1), "valueOf");

assert.throws(Test262Error, () => sample.getBigUint64(bo2), "toString");