feat: add support for SharedArrayBuffer in DataViews#1714
feat: add support for SharedArrayBuffer in DataViews#1714KevinEady wants to merge 1 commit intonodejs:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1714 +/- ##
==========================================
+ Coverage 63.50% 63.54% +0.03%
==========================================
Files 3 3
Lines 2047 2049 +2
Branches 728 728
==========================================
+ Hits 1300 1302 +2
Misses 162 162
Partials 585 585 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| DataView(napi_env env, | ||
| napi_value value); ///< Wraps a Node-API value primitive. | ||
|
|
||
| Napi::ArrayBuffer ArrayBuffer() const; ///< Gets the backing array buffer. |
There was a problem hiding this comment.
We can mark this as deprecated and recommend Buffer().
There was a problem hiding this comment.
I'm actually not so sure about marking this as deprecated anymore. If the add-on author knows for a fact that the DataView will always contain an ArrayBuffer and never a SharedArrayBuffer, it just seems like an extra step for the author to write dataview.Buffer().As<SharedArrayBuffer>() ...
| napi_value value); ///< Wraps a Node-API value primitive. | ||
|
|
||
| Napi::ArrayBuffer ArrayBuffer() const; ///< Gets the backing array buffer. | ||
| Napi::Value Buffer() const; |
There was a problem hiding this comment.
| Napi::Value Buffer() const; | |
| Napi::Value Buffer() const; ///< Gets the backing ArrayBuffer or SharedArrayBuffer. |
Napi::SharedArrayBufferintoNapi::DataView::New()overloadsDataView::Buffer()