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

transformer: 2n ** 32n gets transformed into runtime error Math.pow(2n, 32n) #5822

Open
Boshen opened this issue Sep 17, 2024 · 1 comment
Open
Assignees
Labels
C-bug Category - Bug

Comments

@Boshen
Copy link
Member

Boshen commented Sep 17, 2024

I think we need to bail in this case :-/

tsc and esbuild throws "BigInt literals are not available when targeting lower than ES2020."

@Boshen Boshen added the C-bug Category - Bug label Sep 17, 2024
@overlookmotel
Copy link
Collaborator

overlookmotel commented Sep 17, 2024

Background on why it's not feasible to support BigInt with a polyfill: evanw/esbuild#732

It looks like we should bail on any BigInt literal, not just when used with **.

Side note: Math.pow with any BigInt values is a runtime error, they don't have to be big numbers. e.g. Math.pow(1n, 1n) is a runtime error.

@Boshen Boshen self-assigned this Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category - Bug
Projects
None yet
Development

No branches or pull requests

2 participants