-
Notifications
You must be signed in to change notification settings - Fork 465
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
Fix HandleScope docs #287
Conversation
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. =)
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.
Just some suggestions.
@gabrielschulhof @mhdawson @kfarnung Someone of you have some time to review this PR?
doc/handle_scope.md
Outdated
@@ -15,10 +15,10 @@ the section titled (Object lifetime management)[object_lifetime_management]. | |||
Creates a new handle scope. | |||
|
|||
```cpp | |||
HandleScope HandleScope::New(Napi:Env env); | |||
HandleScope::HandleScope(Napi:Env env); |
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.
HandleScope(Napi::Env env);
doc/handle_scope.md
Outdated
@@ -28,11 +28,11 @@ Returns a new HandleScope | |||
Creates a new handle scope. | |||
|
|||
```cpp | |||
HandleScope HandleScope::New(napi_env env, napi_handle_scope scope); | |||
HandleScope::HandleScope(Napi::Env env, Napi::HandleScope scope); |
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.
HandleScope(Napi::Env env, Napi::HandleScope scope);
doc/handle_scope.md
Outdated
@@ -15,10 +15,10 @@ the section titled (Object lifetime management)[object_lifetime_management]. | |||
Creates a new handle scope. |
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.
I think we should say "Creates a new handle scope on the stack"
doc/handle_scope.md
Outdated
@@ -28,11 +28,11 @@ Returns a new HandleScope | |||
Creates a new handle scope. |
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.
Same comment as above
@rivertam thanks for catching that. You are correct that New does not exist and HandleScopes should be declared on the stack as opposed to allocated. For example:
|
@rivertam made a few additional suggestions, if you can update PR to include those I'll go ahead and land. |
@rivertam do you have time to update this PR based on the comments? |
No I'm sorry. I've been working like crazy. Might be able to get to it next week sometime, but it's probably faster and more effective if you just take it from here. |
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.
LGTM
It turns out `HandleScope::New` doesn't actually exist, fix up doc. PR-URL: #287 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Nicola Del Gobbo <[email protected]>
Landed as 86be13a |
It turns out `HandleScope::New` doesn't actually exist, fix up doc. PR-URL: nodejs/node-addon-api#287 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Nicola Del Gobbo <[email protected]>
It turns out `HandleScope::New` doesn't actually exist, fix up doc. PR-URL: nodejs/node-addon-api#287 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Nicola Del Gobbo <[email protected]>
It turns out `HandleScope::New` doesn't actually exist, fix up doc. PR-URL: nodejs/node-addon-api#287 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Nicola Del Gobbo <[email protected]>
It turns out `HandleScope::New` doesn't actually exist, fix up doc. PR-URL: nodejs/node-addon-api#287 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Nicola Del Gobbo <[email protected]>
It turns out
HandleScope::New
doesn't actually exist, so I'm not sure exactly how that happened.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. =)