Conversation
|
Reviewed: C file is a verbatim copy of upstream, |
|
@legendecas Fixed the CI issue. Can we run the tests again? |
| // Testing api calls for arrays | ||
| const test_dataview = loadAddon("test_dataview"); | ||
|
|
||
| // Test for creating dataview with ArrayBuffer |
There was a problem hiding this comment.
Why is this test scoped in experimentalFeatures.sharedArrayBuffer?
There was a problem hiding this comment.
node_api_is_sharedarraybuffer is experimental and this test uses it.
There was a problem hiding this comment.
CreateDataViewFromJSDataView does not use node_api_is_sharedarraybuffer though.
There was a problem hiding this comment.
CreateDataView uses it.
Shall we split the test case similar to #44 ?
skipping after running CreateDataViewFromJSDataView assertions won't work as the loading of symbols will fail.
There was a problem hiding this comment.
CreateDataView could also not using node_api_is_sharedarraybuffer. Alternatively, we can remove the type check in CreateDataView and rely on node-api implementors to check the types.
There was a problem hiding this comment.
Agreed. We can do that and that simplifies the migration.
There was a problem hiding this comment.
The docs say that napi_create_dataview supports both array buffer and shared array buffer but fails with invalid argument on node v20 & v22
Ports [https://github.com/nodejs/node/tree/main/test/js-native-api/test_dataview](test_dataview) from Node.js test suite to the CTS. This test contains an experimental feature `SharedArrayBuffer`, resulting in usage of `add_node_api_cts_experimental_addon()`. Signed-off-by: Balakrishna Avulapati <ba@bavulapati.com>
node_api_is_sharedarraybuffer is added in v24.9.0 https://nodejs.org/api/n-api.html#node-api-is-sharedarraybuffer Signed-off-by: Balakrishna Avulapati <ba@bavulapati.com>
Signed-off-by: Balakrishna Avulapati <ba@bavulapati.com>
f82ec4f to
3ca85da
Compare
Ports
https://github.com/nodejs/node/tree/main/test/js-native-api/test_dataview from Node.js test suite to the CTS.
This test contains an experimental feature
SharedArrayBuffer, resulting in usage ofadd_node_api_cts_experimental_addon().