-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Conversation
Use the same type check we use in `MoveToContext()` in `ReceiveMessage()`. Fixes: nodejs#32742
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"); |
There was a problem hiding this comment.
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:
"First argument needs to be a MessagePort instance"); | |
'The "port" argument must be a MessagePort instance'); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
LGTM. |
Use the same type check we use in `MoveToContext()` in `ReceiveMessage()`. Fixes: #32742 PR-URL: #32745 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Zeyu Yang <[email protected]>
Landed in a46345d |
Use the same type check we use in `MoveToContext()` in `ReceiveMessage()`. Fixes: #32742 PR-URL: #32745 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Zeyu Yang <[email protected]>
Refs: #32745 (comment) PR-URL: #32815 Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
Refs: #32745 (comment) PR-URL: #32815 Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]>
Use the same type check we use in `MoveToContext()` in `ReceiveMessage()`. Fixes: nodejs#32742 PR-URL: nodejs#32745 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Zeyu Yang <[email protected]>
Use the same type check we use in `MoveToContext()` in `ReceiveMessage()`. Fixes: #32742 PR-URL: #32745 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Zeyu Yang <[email protected]>
Use the same type check we use in `MoveToContext()` in `ReceiveMessage()`. Fixes: #32742 PR-URL: #32745 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Zeyu Yang <[email protected]>
This looks dependent on #27294 which has a backport requested for 10.x label. |
Use the same type check we use in
MoveToContext()
inReceiveMessage()
.Fixes: #32742
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes