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: expose markAsUncloneable api #55234

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jazelly
Copy link
Contributor

@jazelly jazelly commented Oct 2, 2024

External modules need a way to decorate their objects so that node can
recognize it as a host object for serialization process. Exposing a way
for turning off instead of turning on is much safer.

Refs: #55178

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. worker Issues and PRs related to Worker support. labels Oct 2, 2024
@jazelly jazelly changed the title expose uncloneable api worker: expose markAsUncloneable api Oct 2, 2024
@jazelly jazelly force-pushed the expose-uncloneable-api branch 2 times, most recently from f5c09ee to c4fbe5d Compare October 2, 2024 07:09
a [`port.postMessage()`][] call, an error is thrown. This is a no-op if `object` is a
primitive value.

Note, this does not take effect on `ArrayBuffer`, or any `Buffer` like objects.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding is Buffer like objects are from v8 and they have their own SerializeDelegate to handle the Serialization, so marking node's internal flag on or off will not have control over there.

External modules need a way to decorate their objects so that node can
recognize it as a host object for serialization process. Exposing a way
for turning off instead of turning on is much safer.
@jazelly
Copy link
Contributor Author

jazelly commented Oct 2, 2024

cc @legendecas

Copy link

codecov bot commented Oct 2, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.38%. Comparing base (89a2f56) to head (fddddad).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/worker/io.js 81.25% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55234      +/-   ##
==========================================
- Coverage   88.39%   88.38%   -0.02%     
==========================================
  Files         652      652              
  Lines      186565   186586      +21     
  Branches    36046    36043       -3     
==========================================
- Hits       164916   164911       -5     
- Misses      14908    14928      +20     
- Partials     6741     6747       +6     
Files with missing lines Coverage Δ
lib/worker_threads.js 100.00% <100.00%> (ø)
lib/internal/worker/io.js 99.17% <81.25%> (-0.62%) ⬇️

... and 23 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants