GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — setTimeout method of net.Socket should return this by LongTengDao · Pull Request #32722 · nodejs/node

Conversation

@LongTengDao

@LongTengDao LongTengDao commented Apr 8, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

setTimeout method of net.Socket should return this, not undefined, as doc said.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

himself65 and bricss reacted with thumbs up emoji addaleax and bricss reacted with heart emoji
All reactions
  • 👍 2 reactions
  • ❤️ 2 reactions
@LongTengDao
Update stream_base_commons.js
92132c4
addaleax
addaleax approved these changes Apr 8, 2020
View reviewed changes
cjihrig
cjihrig approved these changes Apr 8, 2020
View reviewed changes
@himself65

himself65 commented Apr 8, 2020

Copy link
Copy Markdown
Member

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
+  );
 }));
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@LongTengDao
Update test-net-socket-timeout.js
cc71740
@LongTengDao

LongTengDao commented Apr 8, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@himself65 Thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

himself65
himself65 approved these changes Apr 9, 2020
View reviewed changes
@nodejs-github-bot

nodejs-github-bot commented Apr 9, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/30576/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Flarna
Flarna approved these changes Apr 9, 2020
View reviewed changes
lpinca
lpinca approved these changes Apr 9, 2020
View reviewed changes
ronag
ronag approved these changes Apr 9, 2020
View reviewed changes
ZYSzys
ZYSzys approved these changes Apr 10, 2020
View reviewed changes
@nodejs-github-bot

nodejs-github-bot commented Apr 10, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/30600/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@himself65 himself65 added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Apr 10, 2020
jasnell
jasnell approved these changes Apr 10, 2020
View reviewed changes
@LongTengDao

LongTengDao commented Apr 10, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

CI: https://ci.nodejs.org/job/node-test-pull-request/30576/
CI: https://ci.nodejs.org/job/node-test-pull-request/30600/

What's this? Should I do something?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

trivikr
trivikr approved these changes Apr 11, 2020
View reviewed changes
@himself65

himself65 commented Apr 11, 2020

Copy link
Copy Markdown
Member

CI: https://ci.nodejs.org/job/node-test-pull-request/30576/

CI: https://ci.nodejs.org/job/node-test-pull-request/30600/

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)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

himself65 pushed a commit to himself65/node that referenced this pull request Apr 11, 2020
@LongTengDao @himself65
lib: fix return type of setTimeout in net.Socket
4439009
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]>
@himself65

himself65 commented Apr 11, 2020

Copy link
Copy Markdown
Member

Landed in 4439009

Thanks for your contributions!🎉

LongTengDao reacted with laugh emoji
All reactions
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@himself65 himself65 closed this Apr 11, 2020
@himself65

himself65 commented Apr 11, 2020

Copy link
Copy Markdown
Member

BTW, I reword the commit message for following the commit rules

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

targos pushed a commit that referenced this pull request Apr 12, 2020
@LongTengDao @targos
lib: fix return type of setTimeout in net.Socket
23e56ff
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]>
@targos targos mentioned this pull request Apr 13, 2020
v13.13.0 release proposal #32813
Merged
BethGriggs pushed a commit that referenced this pull request Apr 14, 2020
@LongTengDao @BethGriggs
lib: fix return type of setTimeout in net.Socket
359cabd
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]>
targos pushed a commit that referenced this pull request Apr 22, 2020
@LongTengDao @targos
lib: fix return type of setTimeout in net.Socket
0db5875
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]>
@targos targos mentioned this pull request Apr 22, 2020
v12.16.3 release proposal #33009
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
@addaleax addaleax addaleax approved these changes
@lpinca lpinca lpinca approved these changes
@cjihrig cjihrig cjihrig approved these changes
@ronag ronag ronag approved these changes
@himself65 himself65 himself65 approved these changes
@trivikr trivikr trivikr approved these changes
@Flarna Flarna Flarna approved these changes
@ZYSzys ZYSzys ZYSzys approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

11 participants

@LongTengDao @himself65 @nodejs-github-bot @jasnell @addaleax @lpinca @cjihrig @ronag @trivikr @Flarna @ZYSzys
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.