-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
QUESTION: Why is obj.__proto__=... being used instead of calling Object.create #2613
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
Comments
Because Also, see discussion in #2413 |
|
Sorry for reviving an old issue, but I'm running node v4.2.2 and |
There is currently an open discussion about this (you can find it by looking at the open issues), but the highest minimum we will go for 5.0 is 4.0.0. Regardless, the property is part of the ES6 spec and will likely stick around for some time. Everyone asking so far has not had any legitimate reason not to use it besides "oh, it's deprecated". That's all well and good, but as long as we support node.js versions without setPrototypeOf, we have no other choice. |
closes expressjs#1967 closes expressjs#2613 closes expressjs#3103 closes expressjs#3164
In the ./lib/express.js & in the ./lib/router/index.js (and probably more places) the
__proto__
is being set directly either in the formobj.__proto__ =
... or in the formobj = { __proto__: ... }
Mozilla does not recommend this:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
they say it will heavily impact performance in modern javascript engines... I am not sure how relevant this is to vp8 engine, but Mozilla suggests using
Object.create
instead.Is there a reason why you opted no to use
Object.create
?Just very curious about this decision.
Thank you
The text was updated successfully, but these errors were encountered: