-
-
Notifications
You must be signed in to change notification settings - Fork 487
feat: add SharedArrayBuffer #1688
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
napi.h
Outdated
| }; | ||
| #endif // NODE_ADDON_API_CPP_EXCEPTIONS | ||
|
|
||
| class ArrayBufferLike : public Object { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in f861d36
There was a problem hiding this comment.
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.
Napi::SharedArrayBufferValue::IsSharedArrayBuffer()