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
When running the compiled JS in the presence of a frozen Function.prototype, this module throws on initialization Cannot assign to read only property 'constructor' of object. This is because the TypeScript compiler, when targeting ES5, uses property assignment to replace the prototype.constructor.
This can be solved with a change and possibly an upgrade to the TypeScript compiler, if they are amenable to the change. microsoft/TypeScript#43450
This can alternately be solved by either
moving the language target up to ES2015 (which is technically a breaking change), patching after-the-build (messy),
or creating a secondary build target for ESM and multiplexing package.json with a module property (for RESM https://github.com/standard-things/esm) and an imports property (for Node.js 12+).
The text was updated successfully, but these errors were encountered:
When running the compiled JS in the presence of a frozen
Function.prototype
, this module throws on initializationCannot assign to read only property 'constructor' of object
. This is because the TypeScript compiler, when targeting ES5, uses property assignment to replace theprototype.constructor
.The motivation for freezing all of the shared intrinsic objects is that, in conjunction with compartmentalization of third-party dependencies, it is possible to mitigate some classes of supply chain attack. https://github.com/endojs/endo/tree/master/packages/ses#secure-ecmascript-ses
This can be solved with a change and possibly an upgrade to the TypeScript compiler, if they are amenable to the change. microsoft/TypeScript#43450
This can alternately be solved by either
module
property (for RESM https://github.com/standard-things/esm) and animports
property (for Node.js 12+).The text was updated successfully, but these errors were encountered: