Skip to content

Conversation

@KevinEady
Copy link
Contributor

@KevinEady KevinEady commented Oct 28, 2025

  • Add support for Napi::SharedArrayBuffer
  • Add Value::IsSharedArrayBuffer()
  • Update docs and tests

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.48%. Comparing base (60d439e) to head (02cc813).

Files with missing lines Patch % Lines
napi-inl.h 75.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1688   +/-   ##
=======================================
  Coverage   63.48%   63.48%           
=======================================
  Files           3        3           
  Lines        2046     2046           
  Branches      728      728           
=======================================
  Hits         1299     1299           
  Misses        162      162           
  Partials      585      585           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@KevinEady KevinEady marked this pull request as ready for review October 28, 2025 14:11
@KevinEady
Copy link
Contributor Author

We see in the tests:

  • standard 24.x: Skipped (no SharedArrayBuffer support) [job]
  • experimental 24.x: no skipped message [job]
  • experimental 20.x: Skipped (no SharedArrayBuffer support) as the underlying node-api feature is not in this version [job]

};
#endif // NODE_ADDON_API_CPP_EXCEPTIONS

class ArrayBufferLike : public Object {
Copy link
Member

Choose a reason for hiding this comment

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

Usually we use the name XxxLike when it describes a shape of a protocol. For ArrayBuffer and SharedArrayBuffer, this is not the case. The Napi::ArrayBuffer and Napi::SharedArrayBuffer do not work with a JavaScript mocked ArrayBuffer-like objects.

I think a better name can be ArrayBufferBase. Or just duplicate these two methods as in JavaScript, ArrayBuffer and SharedArrayBuffer have no common ancestry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Need Triage

Development

Successfully merging this pull request may close these issues.

4 participants