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-commenter commented Oct 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.48%. Comparing base (60d439e) to head (f861d36).
⚠️ Report is 1 commits behind head on main.

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]

napi.h Outdated
};
#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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in f861d36

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went with the approach of:

Or just duplicate these two methods as in JavaScript, ArrayBuffer and SharedArrayBuffer have no common ancestry.

@legendecas legendecas moved this from Need Triage to In Progress in Node-API Team Project Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants