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
Clone this repository, in tsconfig.json change target to "esnext", transpile the library source code using tsc and run the output file in literally any JS runtime that supports ES2022 and you shouldsee an error like Uncaught ReferenceError: can't access lexical declaration 'Decimal' before initialization
note: I feel like this isn't a very great explantion of all this, if you need further info just ask me.
The text was updated successfully, but these errors were encountered:
What is the issue?
Break eternity uses static class fields to initialize the Decimal constants like:
FC_NN` is defined as:
Decimal.fromComponents_noNormalize
invokes the Decimal class constructor (new Decimal()
).But apparently static class fields initializers run before the class is ready to be used as a constructor which causes it to throw a TypeError.
How to reproduce?
Clone this repository, in tsconfig.json change target to
"esnext"
, transpile the library source code using tsc and run the output file in literally any JS runtime that supports ES2022 and you shouldsee an error likeUncaught ReferenceError: can't access lexical declaration 'Decimal' before initialization
note: I feel like this isn't a very great explantion of all this, if you need further info just ask me.
The text was updated successfully, but these errors were encountered: