You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 19, 2018. It is now read-only.
From a syntactic perspective, the only thing added is numeric literals of the form 987235987032n. These permit hexadecimal, octal and binary prefixes, but no exponential form, and no decimal place. See the grammar in this section of the proposed spec.
Transform
All arithmetic operations and comparisons should be replaced by calls to functions which provide the appropriate behavior depending whether arguments are BigInts or Numbers.
The transform is slow, so it will really be more of a toy rather than something that should be used in production. For this reason, I'd argue it should be left out of Babel presets.
Polyfill needed--ideally, this would be a thin wrapper around another BigNum library from npm. There are just a few methods to support. Some functions will have to be a bit different to get close to the right behavior, for example, valueOf() should throw a TypeError, so that implicitly casting to Number throws a TypeError, even if it would really return the BigInt. Additionally, the polyfill needs BigInt64Array and DataView operations.
The text was updated successfully, but these errors were encountered:
All arithmetic operations and comparisons should be replaced by calls to functions which provide the appropriate behavior depending whether arguments are BigInts or Numbers.
New Issue: babel/proposals#2
Champion: @littledan
Spec Repo: https://github.com/tc39/proposal-bigint
Spec Text: https://tc39.github.io/proposal-bigint
Slides (to Stage 3 at May TC39 Meeting): https://docs.google.com/presentation/d/1lrcjQzIFgdUXczeeAzs4GkTXJsRQU21UhtmXef70Qic/edit#slide=id.p
Parser
10n
as a valid number. (Check that PR)
987235987032n
. These permit hexadecimal, octal and binary prefixes, but no exponential form, and no decimal place. See the grammar in this section of the proposed spec.Transform
valueOf()
should throw a TypeError, so that implicitly casting to Number throws a TypeError, even if it would really return the BigInt. Additionally, the polyfill needs BigInt64Array and DataView operations.The text was updated successfully, but these errors were encountered: