-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
doc: fix doc for napi_get_typedarray_info #20747
Conversation
The data pointer returned for the typedarray has already been adjusted by the offset so it does not point to the start of the buffer, instead id points to the start of the first element. I think we probably would have liked it to point to the start of the buffer, but we can't change as that would be a breaking change. Update the doc to match the implementation. Fixes: nodejs/node-addon-api#244
doc/api/n-api.md
Outdated
@@ -1750,10 +1750,15 @@ napi_status napi_get_typedarray_info(napi_env env, | |||
properties to query. | |||
- `[out] type`: Scalar datatype of the elements within the `TypedArray`. | |||
- `[out] length`: The number of elements in the `TypedArray`. | |||
- `[out] data`: The data buffer underlying the `TypedArray`. | |||
- `[out] data`: The data buffer underlying the `TypedArray` adjusted by | |||
the byte_offset value so that it points to the first element in the |
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.
byte_offset
-> `byte_offset`
?
doc/api/n-api.md
Outdated
at which the first element of the arrays is located. The value for the data | ||
parameter has already been adjusted so that data points to the first element | ||
in the array. Therefore, the first byte of the native array would be at | ||
data - byte_offset. |
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.
data - byte_offset
-> `data - byte_offset`
?
Will plan to incorporate suggested changes and land when I'm back in the office on Friday, |
Pushed commit to address comments |
CI good landing. |
Landed as 35cf008 |
The data pointer returned for the typedarray has already been adjusted by the offset so it does not point to the start of the buffer, instead id points to the start of the first element. I think we probably would have liked it to point to the start of the buffer, but we can't change as that would be a breaking change. Update the doc to match the implementation. PR-URL: #20747 Fixes: nodejs/node-addon-api#244 Reviewed-By: Gabriel Schulhof <[email protected]> Reviewed-By: James M Snell <[email protected]>
The data pointer returned for the typedarray has already been adjusted by the offset so it does not point to the start of the buffer, instead id points to the start of the first element. I think we probably would have liked it to point to the start of the buffer, but we can't change as that would be a breaking change. Update the doc to match the implementation. PR-URL: #20747 Fixes: nodejs/node-addon-api#244 Reviewed-By: Gabriel Schulhof <[email protected]> Reviewed-By: James M Snell <[email protected]>
The data pointer returned for the typedarray has
already been adjusted by the offset so it does not
point to the start of the buffer, instead id points
to the start of the first element.
I think we probably would have liked it to point to the
start of the buffer, but we can't change as that would be
a breaking change.
Update the doc to match the implementation.
Fixes: nodejs/node-addon-api#244
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes.- [X] documentation is changed or added