MikeMcl / decimal.js

An arbitrary-precision Decimal type for JavaScript
http://mikemcl.github.io/decimal.js
MIT License
6.35k stars 480 forks source link

Assigning to constructor at runtime #228

Open golobitch opened 12 months ago

golobitch commented 12 months ago

Decimal.js is not working with Secure ECMAScript (SES) due to assigning value to constructor at runtime. Constructor must be read-only. This by definition from SES is security concern.

This issue occurs at least here: https://github.com/MikeMcl/decimal.js/blob/7f01abd83d5632005d5f97ddbea41e069ee69a74/decimal.js#L4894

I haven't had time to check for other issues.

I got following error while trying to run this under SES: (TypeError#1) TypeError#1: Cannot assign to read only property 'constructor' of object '[object Object]'