summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Number/prototype/toString/numeric-literal-tostring-radix-poisoned.js
blob: 3c12cbd3974ec863384ef645f41d4ab304072a4d (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
// Copyright 2020 Rick Waldron.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-number.prototype.tostring
description: >
  Else, let radixNumber be ? ToInteger(radix).
---*/

var poisoned = {
  valueOf() {
    throw new Test262Error();
  }
};
assert.throws(Test262Error, () => {
  0..toString(poisoned);
});
assert.throws(Test262Error, () => {
  1..toString(poisoned);
});
assert.throws(Test262Error, () => {
  NaN.toString(poisoned);
});
assert.throws(Test262Error, () => {
  Infinity.toString(poisoned);
});

reportCompare(0, 0);