doc: update example in module registration#17424
doc: update example in module registration#17424fhinkel wants to merge 1 commit intonodejs:masterfrom
Conversation
17cdd4e to
4517c71
Compare
doc/api/n-api.md
Outdated
There was a problem hiding this comment.
Hm – I think this was intentionally C code? At least that’s what the ```c seems to hint at…
There was a problem hiding this comment.
But the other examples have ```C and use nullptr. I'm assuming C and c are the same?
There was a problem hiding this comment.
I think @addaleax's point is that this is mixing c and c++ code?
There was a problem hiding this comment.
@lpinca yes, but the other examples that are labeled as C use nullptr in this file as well, so we're using C++ most of the time anyways. I don't care what we use in the documentation, but it should be consistent throughout the file.
There was a problem hiding this comment.
The API must be usable from C, I'm wondering if we should make the examples C code to avoid any confusion over that but don't feel super strongly about that. Either way we should be consistent.
There was a problem hiding this comment.
@fhinkel if you want to restrict this PR to the original signature change I'm happy to take on going through to make sure we as consistent throughout the doc.
Update return type of `Init` function in documentation to match `napi_addon_register_func` signature. Return type used to be `void`, now it is `napi_value`.
4517c71 to
fd2e875
Compare
|
@mhdawson I've restricted the change to the |
|
Landed in 2475676 |
Update return type of `Init` function in documentation to match `napi_addon_register_func` signature. Return type used to be `void`, now it is `napi_value`. PR-URL: #17424 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Update return type of `Init` function in documentation to match `napi_addon_register_func` signature. Return type used to be `void`, now it is `napi_value`. PR-URL: #17424 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Update return type of `Init` function in documentation to match `napi_addon_register_func` signature. Return type used to be `void`, now it is `napi_value`. PR-URL: #17424 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Update return type of `Init` function in documentation to match `napi_addon_register_func` signature. Return type used to be `void`, now it is `napi_value`. PR-URL: #17424 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
@fhinkel FYI the If you want to note that something should go back to v8.x (which is great, please do add the labels), the one you want is |
Update return type of `Init` function in documentation to match `napi_addon_register_func` signature. Return type used to be `void`, now it is `napi_value`. PR-URL: #17424 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
@gibfahn Thanks! Sorry for using the wrong label. Thanks for fixing/cherry-picking. |
Update return type of `Init` function in documentation to match `napi_addon_register_func` signature. Return type used to be `void`, now it is `napi_value`. PR-URL: nodejs#17424 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Update return type of
Initfunction in documentation to matchnapi_addon_register_funcsignature. Return type used to bevoid, now it isnapi_value.Checklist
make lint(UNIX) passesAffected core subsystem(s)
doc