Merge pull request #1307 from rwaldron/bigint-tostring-returns-decimal-digits-only

BigInt: BigInt .toString() returns only decimal digits, does not include BigIntLiteralSuffix
This commit is contained in:
Daniel Ehrenberg 2017-10-23 09:39:15 +02:00 committed by GitHub
commit db05f2f512
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
// Copyright 2017 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-tostring-applied-to-the-bigint-type
description: BigInt .toString() returns only decimal digits, does not include BigIntLiteralSuffix
info: |
ToString Applied to the BigInt Type
The abstract operation ToString converts a BigInt i to String format as follows:
...
Return the String consisting of the code units of the digits of the decimal representation of i.
features: [BigInt]
---*/
assert.sameValue(BigInt(0).toString(), "0", "BigInt(0).toString() === '0'");
assert.sameValue(BigInt(0n).toString(), "0", "BigInt(0n).toString() === '0'");
assert.sameValue(0n.toString(), "0", "0n.toString() === '0'");