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
it is becoming increasingly common to freeze javascript intrinsics (Object, Array...) (see nodejs, endo/ses, xs)
while this is generally not an issue for packages that do not extend intrinsics, there are a few unfortunate side effects due to javascript's "override mistake", namely obj.constructor = ... fails due to the inherited property "constructor" being read-only on Object.prototype
The text was updated successfully, but these errors were encountered:
kumavis
changed the title
class inheritance pattern not compatible with frozen intrinsics
runtime - class inheritance pattern not compatible with frozen intrinsics
Mar 22, 2021
it is becoming increasingly common to freeze javascript intrinsics (Object, Array...) (see nodejs, endo/ses, xs)
while this is generally not an issue for packages that do not extend intrinsics, there are a few unfortunate side effects due to javascript's "override mistake", namely
obj.constructor = ...
fails due to the inherited property "constructor" being read-only onObject.prototype
here is the inheritance pattern at fault
regenerator/packages/regenerator-runtime/runtime.js
Lines 105 to 106 in 0c2aba1
here is a compatible inheritance pattern
https://github.com/isaacs/inherits/blob/9a2c29400c6d491e0b7beefe0c32efa3b462545d/inherits_browser.js#L6-L13
alternatively you can just use defineProperty instead of assignment
reproduction steps:
The text was updated successfully, but these errors were encountered: