Skip to content

src: migrate off ArrayBufferView::Buffer() - #67733

Open
legendecas wants to merge 3 commits into
nodejs:mainfrom
legendecas:arraybuffer-buffer
Open

legendecas wants to merge 3 commits into
nodejs:mainfrom
legendecas:arraybuffer-buffer

Conversation

@legendecas

Copy link
Copy Markdown
Member

V8 16.0 removes ArrayBufferView::Buffer(). Use GetBuffer() instead,
which is already available in V8 15.8.

Took the commit from the canary-base and added DCHECKs on API assumptions.

Refs: https://crrev.com/c/8794471

V8 16.0 removes `ArrayBufferView::Buffer()`. Use `GetBuffer()` instead,
which is already available in V8 15.8.

Refs: https://crrev.com/c/8794471
Co-Authored-By: Clemens Backes <post@clemens-backes.de>
Co-Authored-By: Joyee Cheung <joyeec9h3@gmail.com>
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/ffi
  • @nodejs/loaders
  • @nodejs/node-api
  • @nodejs/quic
  • @nodejs/sqlite
  • @nodejs/vm
  • @nodejs/wasi

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Nov 23, 2026
@legendecas legendecas added dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v24.x PRs that should not land on the v24.x-staging branch and should not be released in v24.x. dont-land-on-v26.x PRs that should not land on the v26.x-staging branch and should not be released in v26.x. labels Nov 23, 2026
@legendecas

Copy link
Copy Markdown
Member Author

v27.x may get #67070 during Alpha stage so I did not mark this as dont-land-on-v27.x.

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>

@gurgunday gurgunday left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 23, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 23, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.21053% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.52%. Comparing base (3cac7b9) to head (9db058a).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
src/dataqueue/queue.cc 0.00% 4 Missing ⚠️
src/node_blob.cc 50.00% 1 Missing and 1 partial ⚠️
src/ffi/fast.cc 50.00% 0 Missing and 1 partial ⚠️
src/node_buffer.cc 80.00% 0 Missing and 1 partial ⚠️
src/node_wasi.cc 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67733      +/-   ##
==========================================
- Coverage   90.55%   90.52%   -0.03%     
==========================================
  Files         801      803       +2     
  Lines      284215   285060     +845     
  Branches    54883    55001     +118     
==========================================
+ Hits       257358   258062     +704     
- Misses      17014    17148     +134     
- Partials     9843     9850       +7     
Files with missing lines Coverage Δ
src/aliased_buffer-inl.h 94.04% <100.00%> (+0.07%) ⬆️
src/crypto/crypto_random.cc 69.93% <100.00%> (ø)
src/crypto/crypto_util.cc 57.60% <100.00%> (+0.14%) ⬆️
src/crypto/crypto_util.h 68.24% <100.00%> (ø)
src/encoding_binding.cc 56.60% <100.00%> (ø)
src/ffi/data.cc 79.44% <100.00%> (ø)
src/ffi/types.cc 64.23% <100.00%> (ø)
src/heap_utils.cc 80.61% <100.00%> (ø)
src/histogram.cc 86.06% <100.00%> (-0.35%) ⬇️
src/js_native_api_v8.cc 76.66% <100.00%> (ø)
... and 18 more

... and 40 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Ethan-Arrowood

Copy link
Copy Markdown
Contributor

My agent claims you missed one: https://github.com/legendecas/node/blob/0f70c2d2eee1851ef00e0c73f972ada318547e0f/benchmark/napi/function_args/binding.cc#L107

Its in benchmark so I don't think it'd be a big issue but probably worth fixing

Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
@legendecas

Copy link
Copy Markdown
Member Author

@Ethan-Arrowood thanks, fixed!

@gurgunday gurgunday left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@legendecas legendecas added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 23, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 23, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

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++. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v24.x PRs that should not land on the v24.x-staging branch and should not be released in v24.x. dont-land-on-v26.x PRs that should not land on the v26.x-staging branch and should not be released in v26.x. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants