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
To support Type II but not Type III, one obvious thing is to delegate to this.constructor.
I'd like to capture here that delegating to this.constructor is almost definitely not web compatible. Two data points:
Microsoft tried to do this in the ES6 era and had to unship due to breakage. Would be great if someone could dig up the history here...
There is a V8 use counter that counts modifications to .constructor of Arrays instances: https://chromestatus.com/metrics/feature/timeline/popularity/1394. That is an astonishing number of hits. I took a look at the top URL below, https://articlewipe.com. It's doing some kind of mix-in pattern where the .constructor is overridden. Crucially, that overridden .constructor[@@species] is undefined.
The text was updated successfully, but these errors were encountered:
To support Type II but not Type III, one obvious thing is to delegate to
this.constructor
.I'd like to capture here that delegating to
this.constructor
is almost definitely not web compatible. Two data points:Microsoft tried to do this in the ES6 era and had to unship due to breakage. Would be great if someone could dig up the history here...
There is a V8 use counter that counts modifications to
.constructor
of Arrays instances: https://chromestatus.com/metrics/feature/timeline/popularity/1394. That is an astonishing number of hits. I took a look at the top URL below, https://articlewipe.com. It's doing some kind of mix-in pattern where the.constructor
is overridden. Crucially, that overridden.constructor[@@species]
is undefined.The text was updated successfully, but these errors were encountered: