Bug 1896390 - Add getter for Iterator.constructor to eager-ecma-allowlist.js; r=nchev...
[gecko.git] / js / src / tests / test262 / built-ins / Number / prototype / toExponential / range.js
blob32f36b1ea5546f94bd47972a5eba237f03d12884
1 // Copyright (C) 2017 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: sec-number.prototype.toexponential
6 description: Number.prototype.toExponential permits fractionDigits from 0 to 100
7 info: |
8   Number.prototype.toExponential ( fractionDigits )
10   ...
11   8. If _p_ < 0 or _p_ > 100, throw a *RangeError* exception.
12   ...
13 ---*/
15 assert.sameValue((3).toExponential(0), "3e+0");
16 assert.throws(RangeError, () => (3).toExponential(-1));
18 assert.sameValue((3).toExponential(100), "3.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+0");
19 assert.throws(RangeError, () => (3).toExponential(101));
21 reportCompare(0, 0);