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

commented Dec 28, 2018

Refactor common.isMainThread.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
test: remove try/catch in common.isMainThread
Refactor common.isMainThread.
@Trott

This comment has been minimized.

Copy link
Member Author

commented Dec 28, 2018

@BridgeAR
Copy link
Member

left a comment

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

This comment has been minimized.

Copy link
Member Author

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 label Dec 28, 2018

@lpinca
lpinca approved these changes Dec 28, 2018
@Trott

This comment has been minimized.

Copy link
Member Author

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
test: remove try/catch in common.isMainThread
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 added a commit that referenced this pull request Jan 1, 2019
test: remove try/catch in common.isMainThread
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 added a commit to refack/node that referenced this pull request Jan 14, 2019
test: remove try/catch in common.isMainThread
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 referenced this pull request Jan 16, 2019
@MylesBorins MylesBorins referenced this pull request Jan 24, 2019
BethGriggs added a commit that referenced this pull request Apr 28, 2019
test: remove try/catch in common.isMainThread
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 referenced this pull request May 1, 2019
BethGriggs added a commit that referenced this pull request May 10, 2019
test: remove try/catch in common.isMainThread
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 added a commit that referenced this pull request May 16, 2019
test: remove try/catch in common.isMainThread
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.