-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
currently when using BigInt and having the target environment to be es6 you get this error
however no errors occur when you do BigInt(0)
this is actually what some libraries do to test BigInt support, although sometimes for some reason some test BigInt by using the syntax (weird? maybe they weren't informed that using newer syntax on older environments results to everything else in the code not working)
slight suggestion: add a warning if this transform happens as this will still create errors when using on environments where BigInt does not exist
another suggestion: when the BigInt can be represented as a normal JS number (1, 2, anything less than the Number.MAX_SAFE_INTEGER) transform it to BigInt(n)
else wrap it in a string BigInt("n")
Metadata
Metadata
Assignees
Labels
No labels