Skip to content
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

test: remove try/catch in common.isMainThread #25249

Closed
wants to merge 1 commit into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Dec 28, 2018

Refactor common.isMainThread.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Refactor common.isMainThread.
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Dec 28, 2018
@Trott
Copy link
Member Author

Trott commented Dec 28, 2018

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code itself is LG and I like that we do not rely on throwing anymore but is this actually future proof?
As soon as workers get out of experimental they would not be loaded due to the presence of the flag anymore.

@Trott
Copy link
Member Author

Trott commented Dec 28, 2018

As soon as workers get out of experimental they would not be loaded due to the presence of the flag anymore.

We're checking module.builtinModules. Once it's out of experimental, it will always be in that array and the else block will never be run (except on older versions of Node.js that don't have worker_threads). So, yeah, it's future proof.

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 28, 2018
@Trott
Copy link
Member Author

Trott commented Dec 31, 2018

Landed in 9c2b140

@Trott Trott closed this Dec 31, 2018
Trott added a commit to Trott/io.js that referenced this pull request Dec 31, 2018
Refactor common.isMainThread.

PR-URL: nodejs#25249
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request Jan 1, 2019
Refactor common.isMainThread.

PR-URL: #25249
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
refack pushed a commit to refack/node that referenced this pull request Jan 14, 2019
Refactor common.isMainThread.

PR-URL: nodejs#25249
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@BridgeAR BridgeAR mentioned this pull request Jan 16, 2019
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2019
BethGriggs pushed a commit that referenced this pull request Apr 28, 2019
Refactor common.isMainThread.

PR-URL: #25249
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@BethGriggs BethGriggs mentioned this pull request May 1, 2019
BethGriggs pushed a commit that referenced this pull request May 10, 2019
Refactor common.isMainThread.

PR-URL: #25249
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
MylesBorins pushed a commit that referenced this pull request May 16, 2019
Refactor common.isMainThread.

PR-URL: #25249
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@Trott Trott deleted the there-is-no-try branch January 13, 2022 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants