-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
node-api: support SharedArrayBuffer in napi_create_dataview #60473
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
node-api: support SharedArrayBuffer in napi_create_dataview #60473
Conversation
|
Review requested:
|
f2b1f83 to
68ea53e
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #60473 +/- ##
=======================================
Coverage 88.56% 88.56%
=======================================
Files 704 704
Lines 207826 207864 +38
Branches 40035 40052 +17
=======================================
+ Hits 184059 184094 +35
- Misses 15802 15806 +4
+ Partials 7965 7964 -1
🚀 New features to boost your workflow:
|
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
|
I do not think we add macro definitions for changes in behavior (eg. no I see three paths to introduce this to
Thoughts? Or any other ideas? |
|
We can use As for the API changed in this PR, given that the support is still experimental, and #59071 was just released one (or two) minor versions ago, I think it is fine to reuse |
Commit Queue failed- Loading data for nodejs/node/pull/60473 ✔ Done loading data for nodejs/node/pull/60473 ----------------------------------- PR info ------------------------------------ Title node-api: support SharedArrayBuffer in napi_create_dataview (#60473) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch KevinEady:node-api-add-sharedarraybuffer-to-dataview -> nodejs:main Labels c++, node-api, author ready, needs-ci Commits 2 - node-api: support SharedArrayBuffer in napi_create_dataview - fixup! do not use Reflect in tests Committers 2 - Kevin Eady <8634912+KevinEady@users.noreply.github.com> - GitHub <noreply@github.com> PR-URL: https://github.com/nodejs/node/pull/60473 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/60473 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> -------------------------------------------------------------------------------- ℹ This PR was created on Tue, 28 Oct 2025 23:27:04 GMT ✔ Approvals: 3 ✔ - Colin Ihrig (@cjihrig): https://github.com/nodejs/node/pull/60473#pullrequestreview-3393828075 ✔ - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/60473#pullrequestreview-3450380435 ✔ - Anna Henningsen (@addaleax): https://github.com/nodejs/node/pull/60473#pullrequestreview-3461701322 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2025-11-12T10:21:00Z: https://ci.nodejs.org/job/node-test-pull-request/70148/ - Querying data for job/node-test-pull-request/70148/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 60473 From https://github.com/nodejs/node * branch refs/pull/60473/merge -> FETCH_HEAD ✔ Fetched commits as da71ab689518..7b1f34e2f929 -------------------------------------------------------------------------------- Auto-merging doc/api/n-api.md Auto-merging src/js_native_api_v8.cc [main 526901a334] node-api: support SharedArrayBuffer in napi_create_dataview Author: Kevin Eady <8634912+KevinEady@users.noreply.github.com> Date: Wed Oct 29 00:18:58 2025 +0100 5 files changed, 70 insertions(+), 23 deletions(-) [main bf57822ea5] fixup! do not use Reflect in tests Author: Kevin Eady <8634912+KevinEady@users.noreply.github.com> Date: Fri Oct 31 10:46:26 2025 +0100 1 file changed, 1 insertion(+), 1 deletion(-) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. (node:2200) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated. (Use `node --trace-deprecation ...` to show where the warning was created) Rebasing (2/4) Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- node-api: support SharedArrayBuffer in napi_create_dataviewhttps://github.com/nodejs/node/actions/runs/19346144521 |
|
Landed in 9cbf4c9 |
The previous implementation does not support calling
napi_create_dataviewwith aSharedArrayBuffer, as the check forvalue->IsArrayBuffer()returnsfalse, causing the Node-API call to return annapi_invalid_arg.