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

worker: remove redundant function call to setupPortReferencing in setupChild #22298

Closed
wants to merge 1 commit into from

Conversation

oyyd
Copy link
Contributor

@oyyd oyyd commented Aug 13, 2018

There is no need to call setupPortReferencing in setupChild as which has been called with the same arguments in the oninit prototype method of MessagePort.

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

@nodejs-github-bot nodejs-github-bot added the worker Issues and PRs related to Worker support. label Aug 13, 2018

// This test makes sure that we manipulate the references of
// `parentPort` correctly so that the worker threads will
// automatically exit when there are no any other references.
Copy link
Member

Choose a reason for hiding this comment

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

-any

const { isMainThread, parentPort, Worker } = require('worker_threads');

// This test makes sure that we manipulate the references of
// `parentPort` correctly so that the worker threads will
Copy link
Member

Choose a reason for hiding this comment

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

s/threads/thread

assert.strictEqual(code, 0);
}), 1);

worker.on('online', common.mustCall(() => {}, 1));
Copy link
Member

Choose a reason for hiding this comment

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

Nit: the 1 with common.mustCall is obsolete as the default is 1.

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

lpinca commented Aug 18, 2018

@joyeecheung
Copy link
Member

This PR needs a rebase against master to avoid the git failure in the CI.

in `setupChild`

There is no need to call `setupPortReferencing` in `setupChild`
as which has been called with the same arguments in the `oninit`
prototype method of `MessagePort`.
@oyyd
Copy link
Contributor Author

oyyd commented Aug 20, 2018

@joyeecheung The travis CI is green now. PTAL.

@BridgeAR
Copy link
Member

@addaleax
Copy link
Member

Landed in 3b5c992, thanks for the PR! 🎉

@addaleax addaleax closed this Aug 23, 2018
addaleax pushed a commit that referenced this pull request Aug 23, 2018
There is no need to call `setupPortReferencing` in `setupChild`
as which has been called with the same arguments in the `oninit`
prototype method of `MessagePort`.

PR-URL: #22298
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Aug 24, 2018
There is no need to call `setupPortReferencing` in `setupChild`
as which has been called with the same arguments in the `oninit`
prototype method of `MessagePort`.

PR-URL: #22298
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Sep 3, 2018
There is no need to call `setupPortReferencing` in `setupChild`
as which has been called with the same arguments in the `oninit`
prototype method of `MessagePort`.

PR-URL: #22298
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
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. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants