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: fix type check in receiveMessageOnPort #32745

Closed
wants to merge 1 commit into from

Conversation

addaleax
Copy link
Member

@addaleax addaleax commented Apr 9, 2020

Use the same type check we use in MoveToContext() in
ReceiveMessage().

Fixes: #32742

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

Use the same type check we use in `MoveToContext()` in
`ReceiveMessage()`.

Fixes: nodejs#32742
@addaleax addaleax added worker Issues and PRs related to Worker support. lts-watch-v10.x labels Apr 9, 2020
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Apr 9, 2020
@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 9, 2020
@nodejs-github-bot
Copy link
Collaborator

if (!args[0]->IsObject() ||
!env->message_port_constructor_template()->HasInstance(args[0])) {
return THROW_ERR_INVALID_ARG_TYPE(env,
"First argument needs to be a MessagePort instance");
Copy link
Member

Choose a reason for hiding this comment

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

To be consistent with the doc, maybe change to:

Suggested change
"First argument needs to be a MessagePort instance");
'The "port" argument must be a MessagePort instance');

Copy link
Member Author

Choose a reason for hiding this comment

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

@ZYSzys Do you maybe want to open a PR after this lands that makes this consistent across both instances?

Copy link
Member

Choose a reason for hiding this comment

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

Aha, I missed that there is still somewhere else need to be consistent.

Make sense to do it entirely after this lands.

@HarshithaKP
Copy link
Member

LGTM.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

addaleax added a commit that referenced this pull request Apr 13, 2020
Use the same type check we use in `MoveToContext()` in
`ReceiveMessage()`.

Fixes: #32742

PR-URL: #32745
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
@addaleax
Copy link
Member Author

Landed in a46345d

@addaleax addaleax closed this Apr 13, 2020
@addaleax addaleax deleted the messageport-receivemessage branch April 13, 2020 13:08
addaleax added a commit to addaleax/node that referenced this pull request Apr 13, 2020
BethGriggs pushed a commit that referenced this pull request Apr 14, 2020
Use the same type check we use in `MoveToContext()` in
`ReceiveMessage()`.

Fixes: #32742

PR-URL: #32745
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
addaleax added a commit that referenced this pull request Apr 15, 2020
Refs: #32745 (comment)

PR-URL: #32815
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
MylesBorins pushed a commit that referenced this pull request Apr 17, 2020
Refs: #32745 (comment)

PR-URL: #32815
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
@targos targos removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. lts-watch-v12.x labels Apr 25, 2020
targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
Use the same type check we use in `MoveToContext()` in
`ReceiveMessage()`.

Fixes: nodejs#32742

PR-URL: nodejs#32745
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
BridgeAR pushed a commit that referenced this pull request Apr 28, 2020
Use the same type check we use in `MoveToContext()` in
`ReceiveMessage()`.

Fixes: #32742

PR-URL: #32745
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
@BridgeAR BridgeAR mentioned this pull request Apr 28, 2020
targos pushed a commit that referenced this pull request Apr 28, 2020
Use the same type check we use in `MoveToContext()` in
`ReceiveMessage()`.

Fixes: #32742

PR-URL: #32745
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
@richardlau
Copy link
Member

This looks dependent on #27294 which has a backport requested for 10.x label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'worker_threads.receiveMessageOnPort' results in an abort
9 participants