Skip to content

Commit da8af20

Browse files
authored
doc: mention Napi::Env arg for Finalization callback (#1139)
1 parent 5b51864 commit da8af20

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/array_buffer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static Napi::ArrayBuffer Napi::ArrayBuffer::New(napi_env env,
6767
- `[in] externalData`: The pointer to the external data to wrap.
6868
- `[in] byteLength`: The length of the `externalData`, in bytes.
6969
- `[in] finalizeCallback`: A function to be called when the `Napi::ArrayBuffer` is
70-
destroyed. It must implement `operator()`, accept a `void*` (which is the
70+
destroyed. It must implement `operator()`, accept an Napi::Env, a `void*` (which is the
7171
`externalData` pointer), and return `void`.
7272
7373
Returns a new `Napi::ArrayBuffer` instance.
@@ -94,7 +94,7 @@ static Napi::ArrayBuffer Napi::ArrayBuffer::New(napi_env env,
9494
- `[in] externalData`: The pointer to the external data to wrap.
9595
- `[in] byteLength`: The length of the `externalData`, in bytes.
9696
- `[in] finalizeCallback`: The function to be called when the `Napi::ArrayBuffer` is
97-
destroyed. It must implement `operator()`, accept a `void*` (which is the
97+
destroyed. It must implement `operator()`, accept an Napi::Env, a `void*` (which is the
9898
`externalData` pointer) and `Hint*`, and return `void`.
9999
- `[in] finalizeHint`: The hint to be passed as the second parameter of the
100100
finalize callback.

doc/buffer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static Napi::Buffer<T> Napi::Buffer::New(napi_env env,
6565
- `[in] data`: The pointer to the external data to expose.
6666
- `[in] length`: The number of `T` elements in the external data.
6767
- `[in] finalizeCallback`: The function to be called when the `Napi::Buffer` is
68-
destroyed. It must implement `operator()`, accept a `T*` (which is the
68+
destroyed. It must implement `operator()`, accept an Napi::Env, a `T*` (which is the
6969
external data pointer), and return `void`.
7070
7171
Returns a new `Napi::Buffer` object.
@@ -91,7 +91,7 @@ static Napi::Buffer<T> Napi::Buffer::New(napi_env env,
9191
- `[in] data`: The pointer to the external data to expose.
9292
- `[in] length`: The number of `T` elements in the external data.
9393
- `[in] finalizeCallback`: The function to be called when the `Napi::Buffer` is
94-
destroyed. It must implement `operator()`, accept a `T*` (which is the
94+
destroyed. It must implement `operator()`, accept an Napi::Env, a `T*` (which is the
9595
external data pointer) and `Hint*`, and return `void`.
9696
- `[in] finalizeHint`: The hint to be passed as the second parameter of the
9797
finalize callback.

0 commit comments

Comments
 (0)