Skip to content
Snippets Groups Projects
Commit e2ee94f4 authored by Daniel Ehrenberg's avatar Daniel Ehrenberg Committed by Leo Balter
Browse files

Fix tests for toFixed and toExponential (#1080)

toExponential had a typo, and toFixed was against an earlier version
of the specification proposal. The tests pass against a version of V8
which attempts to implement the new spec.
parent b07621de
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ info: >
---*/
assert.sameValue((3).toExponential(0), "3e+0");
assert.throws(RangeError, () => (3).toExponential(0));
assert.throws(RangeError, () => (3).toExponential(-1));
assert.sameValue((3).toExponential(100), "3.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+0");
assert.throws(RangeError, () => (3).toExponential(101));
......
......@@ -3,17 +3,17 @@
/*---
esid: sec-number.prototype.tofixed
description: Number.prototype.toFixed permits fractionDigits from -20 to 100
description: Number.prototype.toFixed permits fractionDigits from 0 to 100
info: >
Number.prototype.toFixed ( fractionDigits )
...
3. If _f_ < -20 or _f_ > 100, throw a *RangeError* exception.
3. If _f_ < 0 or _f_ > 100, throw a *RangeError* exception.
...
---*/
assert.sameValue((3).toFixed(-20), "0");
assert.throws(RangeError, () => (3).toFixed(-21));
assert.sameValue((3).toFixed(-0), "3");
assert.throws(RangeError, () => (3).toFixed(-1));
assert.sameValue((3).toFixed(100), "3.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
assert.throws(RangeError, () => (3).toFixed(101));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment