You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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")
The text was updated successfully, but these errors were encountered:
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)
Which libraries specifically? This sounds like a bug with the library.
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)
Which libraries specifically? This sounds like a bug with the library.
yes the library is also at fault, however this transform would definitely make life easier.
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 stringBigInt("n")
The text was updated successfully, but these errors were encountered: