Skip to content
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

Fix HandleScope docs #287

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix HandleScope docs
It turns out `HandleScope::New` doesn't actually exist, so I'm not sure exactly how that should happen.

Side note: Maybe it should, because I'm getting the error "Entering the V8 API without proper locking in place" when I just construct `HandleScope` so I think I'm missing something important that could be hidden using a factory function, but I don't know because I don't know why I'm running into this issue. =)
  • Loading branch information
rivertam authored Jun 18, 2018
commit b23ead6db400c73662b4eced1a468f611203dc30
10 changes: 5 additions & 5 deletions doc/handle_scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ the section titled (Object lifetime management)[object_lifetime_management].
Creates a new handle scope.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should say "Creates a new handle scope on the stack"


```cpp
HandleScope HandleScope::New(Napi:Env env);
HandleScope::HandleScope(Napi:Env env);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Expand All @@ -28,11 +28,11 @@ Returns a new HandleScope
Creates a new handle scope.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above


```cpp
HandleScope HandleScope::New(napi_env env, napi_handle_scope scope);
HandleScope::HandleScope(Napi::Env env, Napi::HandleScope scope);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Expand Down