Handle BigInt with the %d
and %i
format specifiers
#224
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to close #148 by including special-handling for
BigInt
in the%d
and%i
format specifier logic, that defers to the ECMAScriptBigInt::toString()
abstract operation, which provides a stringified representation of the BigInt that's optimal for that type.BigInt::toString()
abstract operation doesn't addn
suffix to the logged output, which this PR does not call forAll of those implementations specifically do not implement what is standardized right now, which is calling
%parseInt()%
on BigInts formatted with the%d
and%i
specifier, so the shortest path to interoperability is likely to change the spec here (and nudge other implementations to slightly modify their behavior to match this PR, which they're so close to doing). The only browser that implements the current spec behavior is Chromium, and I personally like what the other implementations are doing better. The ecosystem has seemed to naturally drift in the the direction of the non-Chromium implementation too.(The below template will be filled out provided this PR is acceptable).
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff