-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BigInt polyfill for ES2018 #732
Comments
BigInts are not lowered to older syntax in esbuild because there is no direct translation. The BigInt specification decided to use normal JavaScript operators for BigInts and the JavaScript language does not have user-pluggable operator overloading. Code wanting to use BigInts on older browsers will have to be rewritten to use a library that uses function calls instead of native JavaScript operators. That way the function calls can be substituted with older functionality using a polyfill. Here is a quote from https://github.com/GoogleChromeLabs/jsbi:
I haven't tried the JSBI library myself but the approach sounds solid from their description. And I'm not familiar with IPFS's JavaScript tooling. Do they already have a transpilation strategy for BigInts? Maybe it's worth asking them? |
I'm going to close this since this is not something I plan on supporting in esbuild itself, for reasons stated above. |
When compiling ipfs with es2018 target on https://esm.sh, I get the following error
https://esm.sh/ipfs?target=es2018&dev
Maybe we could polyfill BigIntegers for ES2018?
The text was updated successfully, but these errors were encountered: