From e40cabdbf30d4d48803d86e977d4d9a5b0b41ea5 Mon Sep 17 00:00:00 2001 From: Kenvin Davies Date: Mon, 18 Jun 2018 19:02:21 -0400 Subject: [PATCH] doc: Fix HandleScope docs It turns out `HandleScope::New` doesn't actually exist, fix up doc. PR-URL: https://github.com/nodejs/node-addon-api/pull/287 Reviewed-By: Michael Dawson Reviewed-By: Nicola Del Gobbo --- doc/handle_scope.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/handle_scope.md b/doc/handle_scope.md index 898c6e2..81a63fa 100644 --- a/doc/handle_scope.md +++ b/doc/handle_scope.md @@ -12,27 +12,27 @@ the section titled (Object lifetime management)[object_lifetime_management]. ### Constructor -Creates a new handle scope. +Creates a new handle scope on the stack. ```cpp -HandleScope HandleScope::New(Napi:Env env); +HandleScope(Napi:Env env); ``` -- `[in] Env`: The environment in which to construct the HandleScope object. +- `[in] env`: The environment in which to construct the HandleScope object. Returns a new HandleScope ### Constructor -Creates a new handle scope. +Creates a new handle scope on the stack. ```cpp -HandleScope HandleScope::New(napi_env env, napi_handle_scope scope); +HandleScope(Napi::Env env, Napi::HandleScope scope); ``` -- `[in] env`: napi_env in which the scope passed in was created. -- `[in] scope`: pre-existing napi_handle_scope. +- `[in] env`: Napi::Env in which the scope passed in was created. +- `[in] scope`: pre-existing Napi::HandleScope. Returns a new HandleScope instance which wraps the napi_handle_scope handle passed in. This can be used to mix usage of the C N-API @@ -41,7 +41,7 @@ and node-addon-api. operator HandleScope::napi_handle_scope ```cpp -operator HandleScope::napi_handle_scope() const +operator napi_handle_scope() const ``` Returns the N-API napi_handle_scope wrapped by the EscapableHandleScope object.