- Apr 17, 2018
-
-
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>
-
Emily Ford authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/15953 Reviewed-By:
Ruben Bridgewater <ruben@bridgewater.de>
-
Michael Dawson authored
n-api uses size_t for the size of strings when specifying string lengths. V8 only supports a size of int. Add a check so that an error will be returned if the user passes in a string with a size larger than will fit into an int. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/15611 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Daniel Bevenius <daniel.bevenius@gmail.com>
-
rebornix authored
code samples of napi_create_object and napi_property_descriptor were not updated to latest API. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/15581 Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Sampson Gao authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/15508 Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net>
-
Vse Mozhet Byt authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/15449 Reviewed-By:
Refael Ackermann <refack@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Tobias Nießen <tniessen@tnie.de>
-
Gabriel Schulhof authored
Remove the command line flag that was needed for N-API module loading. Re: https://github.com/nodejs/vm/issues/9 Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14902 Reviewed-By:
Refael Ackermann <refack@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Matteo Collina <matteo.collina@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Hitesh Kanwathirtha <digitalinfinity@gmail.com>
-
Sampson Gao authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/15343 Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
-
Sampson Gao authored
Remove napi_is_construct_call and introduce napi_get_new_target. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14698 Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Kyle Farnung <kfarnung@microsoft.com>
-
Jason Ginchereau authored
- Add napi_async_context opaque pointer type. (If needed, we could later add APIs for getting the async IDs out of this context.) - Add napi_async_init() and napi_async_destroy() APIs. - Add async_context parameter to napi_make_callback(). - Add code and checks to test_make_callback to validate async context APIs by checking async hooks are called with correct context. - Update API documentation. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/15189 Fixes: https://github.com/nodejs/node/issues/13254 Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Taylor Woll authored
As per discussion in abi-stable-node: https://github.com/nodejs/abi-stable-node/issues/256, take a refactor to napi_addon_register_func such that the result from the register function is assigned to the module exports property. By making this change, native module can be agnostic about which type of module the environment supports. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/15088 Reviewed-By:
Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
Hitesh Kanwathirtha <digitalinfinity@gmail.com>
-
Jason Ginchereau authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14697 Reviewed-By:
Anna Henningsen <anna@addaleax.net>
-
Anna Henningsen authored
Enable combining N-API async work with async-hooks. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14697 Reviewed-By:
Tobias Nießen <tniessen@tnie.de> Reviewed-By:
Refael Ackermann <refack@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com> Reviewed-By:
Michael Dawson <mhdawson@ibm.com>
-
Gabriel Schulhof authored
The binding testing napi_wrap() creates references to primitives passed into the binding in its second parameter. This is unnecessary and not at all the point of the test. Additionally, creating persistent references to primitive values may not be supported by all VMs, since primitives are best persisted in their native form. Instead, the point of the test is to make sure that the finalize callback gets called when it should get called, that it gets called with the correct pointer, and that it does not get called when it should not get called. Creating persistent references is not necessary for verifying this. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/15289 Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Re: https://github.com/nodejs/node-chakracore/issues/380
-
Gabriel Schulhof authored
Fixes: https://github.com/nodejs/abi-stable-node/issues/51 Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/15216 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By:
Michael Dawson <mhdawson@ca.ibm.com> Reviewed-By:
Timothy Gu <timothygu99@gmail.com>
-
Chris Young authored
Added a wrapper around v8::Isolate::AdjustAmountOfExternalAllocatedMemory Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14310 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Timothy Gu <timothygu99@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Fixes: https://github.com/nodejs/node/issues/13928
-
Gabriel Schulhof authored
Promise is implemented as a pair of objects. `napi_create_promise()` returns both a JavaScript promise and a newly allocated "deferred" in its out-params. The deferred is linked to the promise such that the deferred can be passed to `napi_resolve_deferred()` or `napi_reject_deferred()` to reject/resolve the promise. `napi_is_promise()` can be used to check if a `napi_value` is a native promise - that is, a promise created by the underlying engine, rather than a pure JS implementation of a promise. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14365 Fixes: https://github.com/nodejs/abi-stable-node/issues/242 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Timothy Gu <timothygu99@gmail.com>
-
Daniil Shakir authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14968 Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Kunal Pathak <kunal.pathak@microsoft.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
David Cai <davidcai1993@yahoo.com> Reviewed-By:
Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Daniel Taveras authored
The API for napi_get_value_string_utf8() appears to have been previously changed. This improves the doc reflect the current design. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14529 Fixes: https://github.com/nodejs/node/issues/14398 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
-
Gabriel Schulhof authored
Calling napi_wrap() twice on the same object has the result of returning napi_invalid_arg on the second call. However, sometimes it is necessary to replace the native pointer associated with a given object. This new API allows one to remove an existing pointer, returning the object to its pristine, non-wrapped state. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14658 Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Fixes: https://github.com/nodejs/abi-stable-node/issues/266
-
Kyle Farnung authored
* Reordered string functions alphabetically * Fixed a typo in napi_get_value_string_utf8 Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14678 Fixes: https://github.com/nodejs/node/issues/14397 Refs: https://github.com/nodejs/node/issues/14256 Reviewed-By:
Refael Ackermann <refack@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> Reviewed-By:
Timothy Gu <timothygu99@gmail.com>
-
Refael Ackermann authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14707 Refs: https://github.com/nodejs/node/pull/12756 Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By:
Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
-
Vincent Xue authored
Test errors thrown in addons-napi/test_constructor more specifically. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14318 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Tobias Nießen <tniessen@tnie.de> Reviewed-By:
Gireesh Punathil <gpunathi@in.ibm.com>
-
Anna Henningsen authored
Add `napi_get_node_version`, to help with feature-detecting Node.js as an environment. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14696 Reviewed-By:
Kyle Farnung <kfarnung@microsoft.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Tobias Nießen <tniessen@tnie.de>
-
Jason Ginchereau authored
- Add separate APIs for creating different kinds of numbers, because creating a V8 number value from an integer is faster than creating one from a double. - When getting number values, avoid getting the current context because the context will not actually be used and is expensive to obtain. - When creating values, don't use v8::TryCatch (NAPI_PREAMBLE), because these functions have no possibility of executing JS code. Refs: https://github.com/nodejs/node/issues/14379 Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14573 Reviewed-By:
Timothy Gu <timothygu99@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com>
-
Ben Noordhuis authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14514 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com> Reviewed-By:
Refael Ackermann <refack@gmail.com> Reviewed-By:
Richard Lau <riclau@uk.ibm.com> Reviewed-By:
Timothy Gu <timothygu99@gmail.com> Reviewed-By:
Tobias Nie�en <tniessen@tnie.de>
-
cjihrig authored
Refs: https://github.com/nodejs/node/issues/14138 Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14230 Reviewed-By:
Refael Ackermann <refack@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By:
Tobias Nießen <tniessen@tnie.de>
-
Shivanth MP authored
Basic support for Dataview is added in this commit. This is achieved by using three functions, napi_create_dataview(), napi_is_dataview() and napi_get_dataview_info(). Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14382 Fixes: https://github.com/nodejs/node/issues/13926 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Timothy Gu <timothygu99@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com>
-
Gabriel Schulhof authored
Store the `napi_env` on the global object at a private key. This gives us one `napi_env` per context. Refs: https://github.com/nodejs/node/issues/14367 Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14217 Reviewed-By:
Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By:
Timothy Gu <timothygu99@gmail.com>
-
Pratik Jain authored
Replaced TypeError with RegEx to match the exact error message in file test/addons-napi/test_properties/test.js. The RegEx will check the validity of the error being thrown. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14443 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By:
Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net>
-
Kyle Farnung authored
The `v8::PersistentBase<T>.Get` method didn't exist in node 4 and it's just a helper which creates a new `v8::Local` from the given object. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14211 Reviewed-By:
Timothy Gu <timothygu99@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com>
-
Anna Henningsen authored
Ref: https://github.com/nodejs/node/issues/14379 Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14393 Reviewed-By:
Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Timothy Gu <timothygu99@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com>
-