Object.prototype should be an immutable prototype exotic object
See original GitHub issueYou should not be able to change its prototype with Object.setPrototypeOf
, __proto__
, or any other means. See also: https://github.com/tc39/ecma262/pull/308.
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Object.prototype should be an immutable prototype exotic object
Object.setPrototypeOf(Object.prototype, {}) should fail silently in sloppy mode and throw in strict mode, as should any other mechanism of ...
Read more >Object.prototype.__proto__ - JavaScript - MDN Web Docs
Exceptions. Thrown if attempting to set the prototype of a non-extensible object or an immutable prototype exotic object, such as Object. prototype or...
Read more >699831 - Immutable prototype exotic objects are accepted by ...
The current ECMAScript draft says that objects immutable prototype exotic objects, like Object.prototype, meet that criterion.
Read more >javascript - Uncaught TypeError: Immutable prototype object ...
This is new in ES7 (aka ES2016). The builtin prototype object Object.prototype is now an Immutable Prototype Exotic Objects which has its ...
Read more >Freezing prototypes details - ECMAScript Proposals
ECMA-262 defines Immutable Prototype Exotic Objects, which are objects whose prototype cannot be changed but which still may be extensible.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe @ljharb was mistaken - it should be a TypeError in all modes. He confirms this in his most recent comment.
Okay, thanks for your patience in bringing me up to speed, here. 😃