| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Prefer using Object.setPrototypeOf() instead.
|
Has v8 deprecated __proto__ yet? cc @nodejs/v8 |
Sorry, something went wrong.
|
The ES spec has "deprecated" __proto__ by putting it in annex B, but it will never be removed from engines. Deprecation is dumb on the web and never works, and the whole concept of ES deprecating them is dumb. 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 __proto__ in the codebase though. |
Sorry, something went wrong.
|
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). |
Sorry, something went wrong.
|
Oh I didn't know that ES6 made __proto__ an optional feature for non-browser hosts.
Looks like usage of __proto__ is okay for the time being then. |
Sorry, something went wrong.
|
I wonder if we can actually inherit it from EventEmitter instead of changing prototype. |
Sorry, something went wrong.
|
process object is created during the Environment creation right? Will we be able to load EventEmitter by then? |
Sorry, something went wrong.
|
No, but I think we can instantiate it later, or make this object internal to some object inherited from EventEmitter. |
Sorry, something went wrong.
|
Do you mean creation of process object need not happen at the time of Environment creation? |
Sorry, something went wrong.
|
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! ;) |
Sorry, something went wrong.
|
Okay :-) I was just trying to understand your ideas better. |
Sorry, something went wrong.
|
@JacksonTian could you add the corresponding rule to our linter (in a separate commit) ? |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
Sorry, something went wrong.
|
@targos I will do it. thanks. |
Sorry, something went wrong.
Prefer using Object.setPrototypeOf() instead. PR-URL: #5069 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Prefer using Object.setPrototypeOf() instead. PR-URL: #5069 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Prefer using Object.setPrototypeOf() instead. PR-URL: #5069 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Prefer using Object.setPrototypeOf() instead. PR-URL: #5069 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Prefer using Object.setPrototypeOf() instead. PR-URL: #5069 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Prefer using Object.setPrototypeOf() instead. PR-URL: #5069 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Prefer using Object.setPrototypeOf() instead. PR-URL: nodejs#5069 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
Prefer using Object.setPrototypeOf() instead.