Skip to content
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

core.ts does not test whether BigInt exists #750

Open
retorquere opened this issue Apr 29, 2022 · 4 comments
Open

core.ts does not test whether BigInt exists #750

retorquere opened this issue Apr 29, 2022 · 4 comments

Comments

@retorquere
Copy link

https://github.com/benjamn/ast-types/blob/master/def/core.ts#L338 assumes BigInt to exist, but it doesn't in the environment where my code runs (Zotero, which is technically built on firefox ESR), so my code errors out.

@gnprice
Copy link

gnprice commented May 7, 2022

What version of Firefox is that built on?

MDN says BigInt has been in Firefox since version 68:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#browser_compatibility

That's pretty old, from 2019. The Firefox ESR releases have been based on 68 and later since 2019 too:
https://wiki.mozilla.org/Release_Management/Calendar

So anything using a Firefox release older than that should upgrade urgently, because at this point there are a lot of important security fixes that they're missing.

@retorquere
Copy link
Author

I think they're on esr 60. I currently have bigint aliased to number and that seems to work as a workaround so far but it feels really iffy.

@gnprice
Copy link

gnprice commented May 8, 2022

Cool. I think the right solution here is that Zotero should upgrade to use a version of Firefox that's still supported by Firefox upstream. For Firefox ESR, that's currently Firefox 91:
https://wiki.mozilla.org/Release_Management/Calendar

Quite apart from anything to do with ast-types, that's important because Firefox 60 — like any unsupported years-old version of any web browser — has accumulated numerous important security vulnerabilities that have been fixed in current releases. By staying on such an old version, they're putting their users at risk.

I'd recommend looking in the Zotero issue tracker to see if they already have an issue for upgrading Firefox. Then upvote that, or bump it if it seems inactive, or file a new issue if there isn't one.

Until they do, your workaround sounds like a reasonable one. It's iffy, but not nearly as iffy as using a three-year-old browser version in the first place.

@retorquere
Copy link
Author

retorquere commented May 8, 2022

This is not something I have any influence over. I'll tell them, but don't expect them to move anytime soon. And my worry is that there are libraries that actually use BigInt that could break because I lie to them that BigInt exists when the behavior of BigInt is not according to spec (because it's actually Number).

Would anything break in ast-types if I just apply a patch to remove BigInt there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants