- Apr 17, 2018
-
-
Aaron Kau authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/18414 Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Ruben Bridgewater <ruben@bridgewater.de>
-
Rich Trott authored
* provide block scoping to prevent unintended side effects * remove confusing and unnecessary assertion message * use consisitent `actual, expected` argument order for assertions Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/18340 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Jon Moss <me@jonathanmoss.me> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Michael Dawson authored
This was the only instance were we said a parameter was required. It is assumed parameters are required unless the doc says they are option. Remove `Required` to make consistent with the rest of the doc Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/18184 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By:
Daniel Bevenius <daniel.bevenius@gmail.com>
-
furstenheim authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/18148 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Jon Moss <me@jonathanmoss.me> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Tobias Nießen <tniessen@tnie.de> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com>
-
Jinho Bang authored
According to the ECMA spec, we should throw a RangeError in the following cases: - `(length * elementSize) + offset` > the size of the array passed in - `offset % elementSize` != `0` In the current implementation, this check was omitted. So, the following code will cause a crash. ``` napi_create_typedarray(env, napi_uint16_array, 2 /* length */, buffer, 1 /* byte_offset */, &output_array); ``` This change fixes the problem and write some related tests. Refs: https://tc39.github.io/ecma262/#sec-typedarray-buffer-byteoffset-length Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/18037 Reviewed-By:Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
-
Ali Ijaz Sheikh authored
Some of the API section headers had emphasis, while others did not. Use a consistent style (no emphasis) for all of them, as that matches our other API docs. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/18122 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Kyle Farnung <kfarnung@microsoft.com> Reviewed-By:
Jon Moss <me@jonathanmoss.me> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
-
Ali Ijaz Sheikh authored
Some of the section headers had unbalanced emphasis. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/18122 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Kyle Farnung <kfarnung@microsoft.com> Reviewed-By:
Jon Moss <me@jonathanmoss.me> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
-
Michael Dawson authored
Expose n-api version in process.versions so that it is available for use in javascript by external modules like node-pre-gyp. It was previously accessible through a functon available in the N-API. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/18067 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Minwoo Jung <minwoo@nodesource.com> Reviewed-By:
Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By:
Tobias Nießn <tniessen@tnie.de> Reviewed-By:
Richard Lau <riclau@uk.ibm.com>
-
Jinho Bang authored
The API is required that `byte_length + byte_offset` is less than or equal to the size in bytes of the array passed in. If not, a RangeError exception is raised[1]. [1] https://nodejs.org/api/n-api.html#n_api_napi_create_dataview Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/17869 Reviewed-By:
Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Michael Dawson authored
Examples in the N-API doc used a mix of nullptr and NULL. We should be consistent and because N-API is a 'C' API I believe using NULL is better. This will avoid any potential confusion as to whether N-API can be used with plain C. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/18008 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Tobias Nießen <tniessen@tnie.de> Reviewed-By:
Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com>
-
Nicholas Drane authored
assert.strictEqual accepts 3 arguments, the last of which allows for user-specified error message to be thrown when the assertion fails. Unfortunately, this error message is less helpful than the default when it is vague. This commit removes vague, user-specified error messages, instead relying on clearer, default error messages. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/17812 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Jon Moss <me@jonathanmoss.me> Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com>
-
alnyan authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/17714 Reviewed-By:
Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Timothy Gu <timothygu99@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Rich Trott authored
Remove string literals as messages to `assert.strictEqual()`. They can be misleading here (where perhaps the reason an assertino failed isn't that the deleter wasn't called but rather was called too many times. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/17642 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Jon Moss <me@jonathanmoss.me> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Anatoli Papirovski <apapirovski@mac.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
-
babygoat authored
Add an unhandled rejection function in addons-napi/test_promise/test.js. Also, add a rejection handler to catch the unhandled rejection after introducing the guard and test the reason code. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/17275 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Ruben Bridgewater <ruben@bridgewater.de>
-
Leko authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/17445 Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Jon Moss <me@jonathanmoss.me> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Franziska Hinkelmann authored
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`. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/17424 Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Daniel Bevenius authored
This commit changes two checks which use NULL to use nullptr. I'm not very familiar with N-API but wanted to bring this up in case it was something that was overlooked. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/17276 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Timothy Gu <timothygu99@gmail.com> Reviewed-By:
Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
Lance Ball <lball@redhat.com> Reviewed-By:
Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
MichaëZasso <targos@protonmail.com>
-
Rich Trott authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/17163 Reviewed-By:
Michaël Zasso <targos@protonmail.com> Reviewed-By:
Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com>
-
neta authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/17161 Reviewed-By:
Timothy Gu <timothygu99@gmail.com> Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Refael Ackermann <refack@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By:
Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
-
Anna Henningsen authored
Add a utility functions for addons to use when they need a reference to the current event loop. While the libuv API is not directly part of N-API, it provides a quite stable C API as well, and is tightly integrated with Node itself. As a particular use case, without access to the event loop it is hard to do something interesting from inside a N-API finalizer function, since calls into JS and therefore virtually all other N-API functions are not allowed. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/17109 Reviewed-By:
Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com>
-
Michael Dawson authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16699 Fixes: https://github.com/nodejs/node/issues/13824 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com>
-
ka3e authored
* remove custom messages for assert that conceal values * add comment explaining test * add block scoping Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16814 Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Swathi Kalahastri authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16911 Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Tobias Nießen <tniessen@tnie.de> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
-
Paul Ashfield authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16821 Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com>
-
Vipin Menon authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16879 Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By:
Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Paul Blanche authored
Include unexpected value in assertion messages. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16820 Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Attila Gonda authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16812 Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com>
-
John Byrne authored
The string literal messages in addons-napi/test_buffer/test.js are less helpful than the default messages, so use the default messages. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16808 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
-
Matthew Cantelon authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/15935 Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com>
-
Jayson D. Henkel authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16013 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Evan Lucas <evanlucas@me.com> Reviewed-By:
Michaël Zasso <targos@protonmail.com> Reviewed-By:
Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By:
Ruben Bridgewater <ruben@bridgewater.de>
-
Gabriel Schulhof authored
* namespaced functions such as v8impl::JsHandleScopeFromV8HandleScope become part of Node's public symbols unless they are declared static. * the class uvimpl::Work needs to be enclosed in an anonymous namespace else it, too becomes part of Node's public symbols. * remove references to EXTERNAL_NAPI. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16234 Reviewed-By:
Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
-
Anna Henningsen authored
Fixes: https://github.com/nodejs/node/issues/16175 Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16201 Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com>
-
Michael Dawson authored
Update tests to use module name macro Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16185 Reviewed-By:
Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com>
-
Michael Dawson authored
Update so that doc says to use NAPI_AUTO_LENGTH instead of -1 to indicate null terminate string. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16187 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com>
-
Vse Mozhet Byt authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16202 Reviewed-By:
Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com>
-
Christina Chan authored
Remove redundant error messages for assert.strictEqual() Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16043 Reviewed-By:
Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Gabriel Schulhof authored
test_constructor_name.c should use NODE_GYP_MODULE_NAME. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16146 Reviewed-By:
Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Evan Lucas <evanlucas@me.com>
-
Gabriel Schulhof authored
These changes are necessary in order to retain source compatibility with older versions of node. The removal of `module_version` from `napi_module_register()` is reverted from the flag removal PR, because it should not have been a part of it. `CallbackWrapper::NewTarget()` is renamed to `CallbackWrapper::GetNewTarget()` to distinguish it from V8's native method, thus allowing for a macro which reduces `NewTarget()` to `This()` on V8 versions where it was not yet available. `AsyncResource` is constructed with a C string rather than a V8 string because the former is available on all versions of node. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16102 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com>
-
mrgorbo authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16032 Reviewed-By:
Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Tobias Nießen <tniessen@tnie.de> Reviewed-By:
Timothy Gu <timothygu99@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Kinnan Kwok authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/16037 Reviewed-By:
Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By:
Evan Lucas <evanlucas@me.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Refael Ackermann <refack@gmail.com>
-