summaryrefslogtreecommitdiff
path: root/test/built-ins/DataView/prototype/getBigUint64/return-abrupt-from-tonumber-byteoffset.js
blob: 5482c5d1b65193313c9bad551b1430e5565c414d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// 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");