summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js
blob: 3eb4d9d14c9924af3772391554c31b7fb3ca3e7a (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
28
29
30
31
32
33
// 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.setbigint64
description: >
  Return abrupt from ToBigInt(value)
features: [DataView, ArrayBuffer, BigInt]
---*/

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

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

assert.throws(Test262Error, function() {
  sample.setBigInt64(0, bo1);
}, "valueOf");

assert.throws(Test262Error, function() {
  sample.setBigInt64(0, bo2);
}, "toString");

reportCompare(0, 0);