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

entire library won't work if BigInt syntax is unsupported #359

Open
cyan-2048 opened this issue May 12, 2024 · 0 comments
Open

entire library won't work if BigInt syntax is unsupported #359

cyan-2048 opened this issue May 12, 2024 · 0 comments

Comments

@cyan-2048
Copy link

this library seems to check for BigInt support, however a simple typeof BigInt won't suffice

using the BigInt syntax (ex. 1n, 345n) would cause a SyntaxError: identifier starts immediately after numeric literal on browsers that don't support it, so the entire script file won't work if this library is present

and no, SyntaxErrors won't get caught even with try-catch, the entire script will just refuse to run

suggestion:
create a different import for no-bigint
import("buffer/no-bigint")
and replace all the bigint related methods with the bigint unsupported error function

for the default import("buffer")
it should import("buffer/no-bigint") and set the bigint related methods

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

1 participant