Bug 1897246 - Implement "Add to Home screen" menu functionality. r=android-reviewers,gl
[gecko.git] / js / src / tests / test262 / built-ins / Number / prototype / toExponential / infinity.js
blobb9870e5902dfde11c6d94f3cf6a5ddd609a0b34d
1 // Copyright (C) 2016 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: >
7   Return signed Infinity string if this is Infinity
8 info: |
9   Number.prototype.toExponential ( fractionDigits )
11   1. Let x be ? thisNumberValue(this value).
12   [...]
13   5. Let s be the empty String.
14   6. If x < 0, then
15     a. Let s be "-".
16     b. Let x be -x.
17   7. If x = +∞, then
18     a. Return the concatenation of the Strings s and "Infinity".
19   [...]
20 ---*/
22 assert.sameValue((+Infinity).toExponential(1000), "Infinity", "Infinity value");
23 var n = new Number(+Infinity);
24 assert.sameValue(n.toExponential(1000), "Infinity", "Number Infinity");
26 assert.sameValue((-Infinity).toExponential(1000), "-Infinity", "-Infinity value");
27 var n = new Number(-Infinity);
28 assert.sameValue(n.toExponential(1000), "-Infinity", "Number -Infinity");
30 reportCompare(0, 0);