-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
setTimeout method of net.Socket should return this #32722
Conversation
need a test update for this? diff --git a/test/parallel/test-net-socket-timeout.js b/test/parallel/test-net-socket-timeout.js
index 8b197b44d6..e01304afe5 100644
--- a/test/parallel/test-net-socket-timeout.js
+++ b/test/parallel/test-net-socket-timeout.js
@@ -70,8 +70,12 @@ for (let i = 0; i < invalidCallbacks.length; i++) {
const server = net.Server();
server.listen(0, common.mustCall(() => {
const socket = net.createConnection(server.address().port);
- socket.setTimeout(1, common.mustCall(() => {
- socket.destroy();
- server.close();
- }));
+ assert.strictEqual(
+ socket.setTimeout(1, common.mustCall(() => {
+ socket.destroy();
+ assert.strictEqual(socket.setTimeout(1, common.mustNotCall()), socket);
+ server.close();
+ })),
+ socket
+ );
})); |
@himself65 Thank you! |
What's this? Should I do something? |
no, we will land this after ci all green(ci sometimes will crash, I don’t know why) |
Function setTimeout in net.Socket should return this, not undefined, as doc said. PR-URL: nodejs#32722 Refs: https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
Landed in 4439009 Thanks for your contributions!🎉 |
BTW, I reword the commit message for following the commit rules |
Function setTimeout in net.Socket should return this, not undefined, as doc said. PR-URL: #32722 Refs: https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
Function setTimeout in net.Socket should return this, not undefined, as doc said. PR-URL: #32722 Refs: https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
Function setTimeout in net.Socket should return this, not undefined, as doc said. PR-URL: #32722 Refs: https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
setTimeout method of net.Socket should return this, not undefined, as doc said.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes