Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isn't `__proto__` standard now? Why do I get a deprecation warning? #914

Closed
serapath opened this issue Jun 12, 2017 · 4 comments

Comments

@serapath
Copy link

commented Jun 12, 2017

Since __proto__ became standard, i like to use it a lot and feel it makes it totally straight forward to set the prototype chain.

What is the reason that there is a warning?
Since it's standard now - would it be an option to remove the warning? :-)

@Jessidhia

This comment has been minimized.

Copy link

commented Jun 14, 2017

It is deprecated. __proto__ is specified in Annex B, and it is done to document what browsers happen to do in reality, even if it is not desirable.

https://tc39.github.io/ecma262/#sec-additional-ecmascript-features-for-web-browsers

"This annex describes various legacy features and other characteristics of web browser based ECMAScript implementations. All of the language features and behaviours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification."

(...)

"These features are not considered part of the core ECMAScript language. Programmers should not use or assume the existence of these features and behaviours when writing new ECMAScript code. "

@serapath

This comment has been minimized.

Copy link
Author

commented Jun 17, 2017

Ok, then I will just ignore the warning and continue to use it.
I find it highly desirable. It makes things very straightforward that are otherwise unnecessarily complicated.
Have never seen a good argument why __proto__ would be a bad idea other than the plain opinion that it would somehow be undesirable. I find class a lot more undesirable and it's even part of the standard :/

@aladdin-add

This comment has been minimized.

Copy link
Contributor

commented Jun 20, 2017

no. it is recommended to use Object.getPrototypeOf() and Object.setPrototypeOf() (ES6).

@stale

This comment has been minimized.

Copy link

commented May 10, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label May 10, 2018

@stale stale bot closed this May 17, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Aug 15, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.