info, &argc, args, nullptr, nullptr); void *arrayBufferPtr = nullptr; size_t compareSize = 0; napi_status result = napi_get_arraybuffer_info(env, args[0], &arrayBufferPtr, &compareSize); napi_value arrayBuffer =
static napi_value Multiply(napi_env env, napi_callback_info info) { size_t argc = 2; ...
napi_get_arraybuffer_info接口单元测试覆盖data为nullptr的情况 如何复现该缺陷 检视代码 其他补充信息 版本或分支信息 master Release 4.1 Release 4.0 Release 3.2 milkpotatoes创建了任务11个月前 milkpotatoes添加了 bug 标签11个月前 展开全部操作日志
✓ 已被采纳 在C++代码中,获取传入的ArrayBuffer参数后,调用napi_get_arraybuffer_info接口,传入相应参数,该接口会将ArrayBuffer的信息(如字节长度、数据指针等)填充到对应的变量中,进而可以获取并返回需要的信息。示例代码如下: #include "napi/native_api.h" static napi_value GetArrayBufferInfo(napi_env env, n...
napi_get_typedarray_info(env, input_array, &type, &length, NULL, &input_buffer, &byte_offset); void *data; size_t byte_length; napi_get_arraybuffer_info(env, input_buffer, &data, &byte_length); napi_value output_buffer; void *output_ptr = NULL; napi_create_arraybuffer(env, byte_le...
Version: 12.13.0 Platform: Linux dev-linux 5.3.0-19-generic x86_64 x86_64 x86_64 GNU/Linux The issue happens when passing a Buffer object down to a native module and one calls napi_get_typedarray_info() getting the arraybuffer object and...
[1], &multiplier); napi_typedarray_type type; napi_value input_buffer; size_t byte_offset; size_t i, length; napi_get_typedarray_info(env, input_array, &type, &length, NULL, &input_buffer, &byte_offset); void *data; size_t byte_length; napi_get_arraybuffer_info(env, ...