-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
src: clean up usage of __proto__ #5069
Conversation
Prefer using Object.setPrototypeOf() instead.
Has v8 deprecated |
The ES spec has "deprecated" That said, I still think it's reasonable to do this replacement, because it's prettier. I'm surprised this is the only usage of |
This may be a silly question, but do these two things do exactly the same thing internally, at least in v8? I'm thinking about if there would be any weird/unexpected changes in performance using one method over the other (as far as object property access goes, not the time spent actually setting the prototype during startup). |
Oh I didn't know that ES6 made
Looks like usage of |
I wonder if we can actually inherit it from |
process object is created during the Environment creation right? Will we be able to load EventEmitter by then? |
No, but I think we can instantiate it later, or make this object internal to some object inherited from EventEmitter. |
Do you mean creation of process object need not happen at the time of Environment creation? |
There is no hard requirement for this. I'm just throwing out random ideas, it doesn't mean that they should be turn into code :) At least not immediately! ;) |
Okay :-) I was just trying to understand your ideas better. |
@JacksonTian could you add the corresponding rule to our linter (in a separate commit) ? |
LGTM |
LGTM |
@targos I will do it. thanks. |
Prefer using Object.setPrototypeOf() instead. PR-URL: #5069 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in 9aebb00 |
Prefer using Object.setPrototypeOf() instead. PR-URL: #5069 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
Prefer using Object.setPrototypeOf() instead. PR-URL: #5069 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
Prefer using Object.setPrototypeOf() instead. PR-URL: #5069 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
Prefer using Object.setPrototypeOf() instead. PR-URL: #5069 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
Prefer using Object.setPrototypeOf() instead. PR-URL: #5069 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
Prefer using Object.setPrototypeOf() instead. PR-URL: nodejs#5069 Reviewed-By: Trevor Norris <[email protected]> Reviewed-By: James M Snell <[email protected]>
Prefer using Object.setPrototypeOf() instead.