-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: document common pattern for instanceof checks #16699
Conversation
can you also document |
@devsnek I believe |
@mhdawson ok, sorry for the mixup 👍 |
doc/api/n-api.md
Outdated
status = napi_instanceof(env, es_this, MyClass_constructor, &is_instance); | ||
assert(napi_ok == status); | ||
if (is_instance) { | ||
// napi_unwrap() ... |
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.
Should indentation be two spaces here and a couple lines down?
doc/api/n-api.md
Outdated
} | ||
``` | ||
|
||
Of course the reference must be freed once it is no longer needed. |
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.
You can drop "Of course"
@cjihrig thanks for the comments will update to fix and then land when I'm back from vacation in a week. |
Failure on Fedora looks unrelated
Given that this is a doc change. |
Landed as 9b4ab14 |
PR-URL: nodejs#16699 Fixes: nodejs#13824 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Fixes: #13824
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
doc