Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a29adef

Browse filesBrowse files
Trottaddaleax
authored andcommitted
test,worker: simplify common.isMainThread
Now that `worker_threads` do not require a flag, the logic around loading `isMainThread` can be removed. PR-URL: #25426 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent f0409be commit a29adef
Copy full SHA for a29adef

File tree

Expand file treeCollapse file tree

1 file changed

+1
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-7
lines changed
Open diff view settings
Collapse file

‎test/common/index.js‎

Copy file name to clipboardExpand all lines: test/common/index.js
+1-7Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,7 @@ const noop = () => {};
4646

4747
const hasCrypto = Boolean(process.versions.openssl);
4848

49-
const isMainThread = (() => {
50-
if (require('module').builtinModules.includes('worker_threads')) {
51-
return require('worker_threads').isMainThread;
52-
}
53-
// Worker module not enabled → only a single main thread exists.
54-
return true;
55-
})();
49+
const { isMainThread } = require('worker_threads');
5650

5751
// Check for flags. Skip this for workers (both, the `cluster` module and
5852
// `worker_threads`) and child processes.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.