Possibly broken in IE11
See original GitHub issueI noticed that JSBI is broken in a test application when running in IE11.
When I exclude JSBI in webpacks babel-loader exclude (jsbi is parsed like the rest of my code):
This possibly points to:
if (!_(t) || i(t) !== t) throw new RangeError("The number " + t + " cannot be converted to BigInt because it is not an integer");
I use core-js@3 and regenerator-runtime as polyfills. Maybe I need something else as well?
When I do not exlude JSBI and treat it like any other dependency (jsbi is included in babel-loader):
This time it is unfortunately absolutely impossible to tell what upsets poor IE. Maybe its the same statement, who knows 🤷♂️.
Is the UMD version tested? Works fine in Firefox 80, but not in IE11.
I also noticed https://github.com/GoogleChromeLabs/jsbi/issues/42. I tested importing the common-js and mjs versions directly, however I still get similar results. IE is broken while Firefox works.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
I just wanted to say, I have successfully used JSBI with IE. Thank you so much @jakobkummerow @mathiasbynens @Miladiir
Looks like IE11 doesn’t support
Math.imul
andMath.clz32
, which JSBI uses. At least, that’s the result I get when I comment out “minify()” in rollup.config.js, regenerate the UMD version, and testvar a = JSBI.BigInt('12345678901234567890')
with that on an IE11 VM.As a short-term workaround, you can provide a very simple polyfill (which does not have the proper semantics, but is good enough for JSBI):
If you’re worried about breaking other modules that might want to use these functions, you can find functionally fully correct polyfills on MDN.
I know next to nothing about Babel. Presumably it has a way to polyfill Math functions, but I don’t know how to make it do that.