Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
src: use JS inheritance for AsyncWrap#23094
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
For all classes descending from `AsyncWrap`, use JS inheritance instead of manually adding methods to the individual classes. This allows cleanup of some code around transferring handles over IPC.
nodejs-github-bot commented Sep 25, 2018
addaleax commented Sep 25, 2018 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
joyeecheung left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YES!!!
Left a few comments, but nothing blocking.
Uh oh!
There was an error while loading. Please reload this page.
src/env.h Outdated
| V(async_hooks_init_function, v8::Function) \ | ||
| V(async_hooks_promise_resolve_function, v8::Function) \ | ||
| V(async_wrap_constructor_template, v8::FunctionTemplate) \ | ||
| V(async_wrap_object_constructor_template, v8::FunctionTemplate) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use ctor for this name as well, for consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jasnell commented Sep 28, 2018
Definitely a good idea, I think, but is this going to be semver-major? |
addaleax commented Sep 29, 2018
@jasnell If necessary, I would be okay with that, but could you explain why this is semver-major? It doesn’t touch public API or remove methods, it just moves them to a different position on the prototype chain (of internal objects). |
jasnell commented Sep 29, 2018
Largely defensive. It shouldn't be breaking but as we've seen many times, it pays to be careful. At the very least we need a citgm run to be sure |
addaleax commented Sep 29, 2018
I ran CITGM – there are a lot of failures because of #23122, but in the diff between the run here and the master run, I didn’t find anything that would point to issues with this PR. |
jasnell commented Sep 29, 2018
Hopefully ok then :) |
addaleax commented Sep 29, 2018
@jasnell I think this will require a backport PR for v10.x anyway … let’s run CITGM on that as well, that should give a much clearer picture. |
joyeecheung left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still LGTM
addaleax commented Sep 30, 2018
New CI: https://ci.nodejs.org/job/node-test-pull-request/17517/ (This still needs to wait for a second approval, or two more days.) |
danbev commented Oct 2, 2018
Re-run of node-test-commit-aix. |
addaleax commented Oct 3, 2018
addaleax commented Oct 3, 2018
Btw, @joyeecheung … just thinking out loud: The most natural way to do mirror the C++ multiple inheritance might be to create a second native JS class (e.g. That sounds semver-major to me, though, and I still have some native stream refactoring that I’d like to do, so maybe I’d keep that approach in mind and we could implement it late in the Node 11 release cycle? |
joyeecheung commented Oct 3, 2018
Isn't that kind of like (Or..maybe we should do it the other way around, why does |
addaleax commented Oct 3, 2018
Because it’s both a class that wraps a libuv handle, and is a stream at the same time – it does make sense to use multiple inheritance here… |
addaleax commented Oct 3, 2018
… and again, Windows: https://ci.nodejs.org/job/node-test-commit-windows-fanned/21229/ |
addaleax commented Oct 3, 2018
Landed in d527dde |
For all classes descending from `AsyncWrap`, use JS inheritance instead of manually adding methods to the individual classes. This allows cleanup of some code around transferring handles over IPC. PR-URL: #23094 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]>
For all classes descending from `AsyncWrap`, use JS inheritance instead of manually adding methods to the individual classes. This allows cleanup of some code around transferring handles over IPC. PR-URL: nodejs#23094 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]>
For all classes descending from `AsyncWrap`, use JS inheritance instead of manually adding methods to the individual classes. This allows cleanup of some code around transferring handles over IPC. Backport-PR-URL: #23247 PR-URL: #23094 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]>
For all classes descending from `AsyncWrap`, use JS inheritance instead of manually adding methods to the individual classes. This allows cleanup of some code around transferring handles over IPC. Backport-PR-URL: #23247 PR-URL: #23094 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]>
For all classes descending from `AsyncWrap`, use JS inheritance instead of manually adding methods to the individual classes. This allows cleanup of some code around transferring handles over IPC. PR-URL: #23094 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]>
For all classes descending from
AsyncWrap, use JS inheritanceinstead of manually adding methods to the individual classes.
This allows cleanup of some code around transferring handles
over IPC.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes