Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / BigInt / constructor-trailing-leading-spaces.js
blob2fd8e7421894c01b1638405538f06a9e7560c578
1 // Copyright (C) 2017 Caio Lima. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 description: Trailing/Leading spaces should be ignored in BigInt constructor
6 esid: sec-string-to-bigint
7 info: |
8   ToBigInt ( argument )
10   String:
12   Let n be StringToBigInt(prim).
13   If n is NaN, throw a SyntaxError exception.
14   Return n.
16   StringToBigInt ( argument )
18   Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow Infinity, decimal points, or exponents.
21 features: [BigInt]
22 ---*/
24 assert.sameValue(BigInt("   0b1111"), 15n);
25 assert.sameValue(BigInt("18446744073709551616   "), 18446744073709551616n);
26 assert.sameValue(BigInt("   7   "), 7n);
27 assert.sameValue(BigInt("   -197   "), -197n);
28 assert.sameValue(BigInt("     "), 0n);
30 reportCompare(0, 0);