Bug 1896390 - Add getter for Iterator.constructor to eager-ecma-allowlist.js; r=nchev...
[gecko.git] / js / src / tests / test262 / built-ins / Number / prototype / toString / S15.7.4.2_A3_T01.js
blob665dd22563725e378799a593f4b7699c909f5608
1 // Copyright 2009 the Sputnik authors.  All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 info: "toString: radix should be an integer between 2 and 36"
6 es5id: 15.7.4.2_A3_T01
7 description: radix is 1
8 ---*/
10 try {
11   var n = Number.prototype.toString(1);
12   throw new Test262Error('#1: Number.prototype.toString(1) should throw an Error');
14 catch (e) {}
16 try {
17   var n = (new Number()).toString(1);
18   throw new Test262Error('#2: (new Number()).toString(1) should throw an Error');
20 catch (e) {}
22 try {
23   var n = (new Number(0)).toString(1);
24   throw new Test262Error('#3: (new Number(0)).toString(1) should throw an Error');
26 catch (e) {}
28 try {
29   var n = (new Number(-1)).toString(1);
30   throw new Test262Error('#4: (new Number(-1)).toString(1) should throw an Error');
32 catch (e) {}
34 try {
35   var n = (new Number(1)).toString(1);
36   throw new Test262Error('#5: (new Number(1)).toString(1) should throw an Error');
38 catch (e) {}
40 try {
41   var n = (new Number(Number.NaN)).toString(1);
42   throw new Test262Error('#6: (new Number(Number.NaN)).toString(1) should throw an Error');
44 catch (e) {}
46 try {
47   var n = (new Number(Number.POSITIVE_INFINITY)).toString(1);
48   throw new Test262Error('#7: (new Number(Number.POSITIVE_INFINITY)).toString(1) should throw an Error');
50 catch (e) {}
52 try {
53   var n = (new Number(Number.NEGATIVE_INFINITY)).toString(1);
54   throw new Test262Error('#8: (new Number(Number.NEGATIVE_INFINITY)).toString(1) should throw an Error');
56 catch (e) {}
58 reportCompare(0, 0);