-
Notifications
You must be signed in to change notification settings - Fork 48
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
Failed to run in SES #20
Comments
What is SES? In JavaScript, |
Hi! SES is a secured EcmaScript environment (and it's polyfill), in that environment, every built-in object (including When But very unluck, when the prototype is frozen, write the property without Object.defineProperty will throw an error:
Is it possible to do this? if (Object.defineProperty) Object.defineProperty(this, 'constructor', { value: Decimal })
else this.constructor = Decimal |
Is this the only change required to make this library SES-compatible? Anyway, this is a very hot code path and adding another SES and similar efforts look interesting but they seem too marginal at the moment for me to start making changes to support them. |
Maybe not, it is just the first error that appears, maybe some other assignments need to be changed too.
Thanks for your reply, maybe I will choose to patch the package in the node_modules to fix the problem. |
https://github.com/MikeMcl/decimal.js-light/blob/master/decimal.js#L1862
Change this line to
can fix the problem, but this looks like a compiled file, I don't know how to make a PR
The text was updated successfully, but these errors were encountered: