3 ms·
> while in Javascript you can't --- once the object's been constructed, that's it. ES2015 standardised the read/write __proto__ attribute (which most browsers
by masklinn 11y ago
> while in Javascript you can't --- once the object's been constructed, that's it.
ES2015 standardised the read/write __proto__ attribute (which most browsers had implemented for a long time), and added a #setPrototypeOf call. The first answer of your link notes exactly that.
- david-given 11y agoIt's added as an optional feature, as the first sentence of that answer describes: > ...the answer below is no longer accurate. _proto_ is being added to ecmascript6 as "normative optional" which means it isn't required to be implemented... It can't always be polyfilled, either, which makes the feature effectively useless. I'm not even sure why they added it as such a half-hearted feature to ES6; I suspect politics (Brendon Eich appears to have been dead set against having mutable protos for years).
- masklinn 11y ago> It's added as an optional feature Fuck's sake mate, Object.setPrototypeOf is not optional (and __proto__ is only optional for non-browser environments). > It can't always be polyfilled, either, which makes the feature effectively useless. That's breathtaking dishonesty.