- Apr 17, 2018
-
-
Ben Noordhuis authored
Not an actual bug, as far as I can tell, the compiler is simply not smart enough to figure out that the offending code path isn't reached with an uninitialized value. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14053 Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By:
Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By:
Michaël Zasso <targos@protonmail.com>
-
Ben Noordhuis authored
Fixes the following deprecation warning: ../src/node_api.cc:2020:30: warning: 'bool v8::Object::SetPrototype(v8::Local<v8::Value>)' is deprecated: Use maybe version [-Wdeprecated-declarations] wrapper->SetPrototype(proto); ../src/node_api.cc:2021:28: warning: 'bool v8::Object::SetPrototype(v8::Local<v8::Value>)' is deprecated: Use maybe version [-Wdeprecated-declarations] obj->SetPrototype(wrapper); Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/14053 Reviewed-By:Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By:
Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By:
Michaël Zasso <targos@protonmail.com>
-
cjihrig authored
Fixes: https://github.com/nodejs/node/issues/13924 Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13934 Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com>
-
cjihrig authored
Refs: https://github.com/nodejs/node/issues/13924 Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13949 Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com>
-
cjihrig authored
Refs: https://github.com/nodejs/node/issues/13925 Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13961 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Evan Lucas <evanlucas@me.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
-
Kyle Farnung authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13972 Reviewed-By:
Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By:
Richard Lau <riclau@uk.ibm.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Michael Dawson authored
Document the lifetime of the structure returned by napi_get_last_error_info Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13939 Fixes: https://github.com/nodejs/abi-stable-node/issues/251 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By:
Hitesh Kanwathirtha <digitalinfinity@gmail.com>
-
Michael Dawson authored
V8 will crash if escape is called twice on the same scope. Add checks to avoid crashing if napi_escape_scope() is called to try and do this. Add test that tries to call napi_create_scope() twice. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13651 Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Ben Noordhuis <info@bnoordhuis.nl>
-
Michael Dawson authored
- Add doc for napi_create_string_latin1(). - Fix signatures where c string was specified instead of napi_value. - Fix return type of napi_callback. - Update to specify that napi_escape_handle() can only be called once for a given scope. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13650 Fixes: https://github.com/nodejs/node/issues/13555 Fixes: https://github.com/nodejs/node/issues/13556 Fixes: https://github.com/nodejs/node/issues/13562 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com> Reviewed-By:
Ingvar Stepanyan <me@rreverser.com>
-
XadillaX authored
The earlier version `napi_callback` returns `void` but now is `napi_value`. The document of this section hasn't been modified. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13570 Fixes: https://github.com/nodejs/node/issues/12248 Fixes: https://github.com/nodejs/node/issues/13562 Reviewed-By:
Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Jamen Marzonie authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13544 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Anna M. Kedzierska <anna.m.kedzierska@gmail.com> Reviewed-By:
Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com>
-
Michael Dawson authored
We did not have test coverage for using a napi_value pointing to a string or symbol for the name when creating a property. Add that coverage. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13510 Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com>
-
Michael Dawson authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13508 Fixes: https://github.com/nodejs/node/issues/13469 Fixes: https://github.com/nodejs/node/issues/13458 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com>
-
Jamen Marz authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13484 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
-
Michael Dawson authored
Since its guarded in by a command line option say that in the docs and provide the option that needs to be used to enable it. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13406 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Tobias Nießn <tniessen@tnie.de> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com> Reviewed-By:
Gibson Fahnestock <gibfahn@gmail.com>
-
Jason Ginchereau authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13412 Reviewed-By:
Anna Henningsen <anna@addaleax.net>
-
Michael Dawson authored
It takes time to build each of the addons used to test n-api. Consolidate a few of the smaller ones to save build time. Get rid of one more small addon. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13380 Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com>
-
Michael Dawson authored
It takes time to build each of the addons used to test n-api. Consolidate a few of the smaller ones to save build time. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13317 Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com>
-
Jason Ginchereau authored
Previously, napi_wrap() would only work with objects created from a constructor returned by napi_define_class(). While the N-API team was aware of this limitation, it was not clearly documented and is likely to cause confusion anyway. It's much simpler if addons are allowed to use any JS object. Also, the specific behavior of the limitation is difficult to reimplement on other VMs that work differently from V8. V8 requires object internal fields to be declared on the object prototype (which napi_define_class() used to do). Since it's too late to modify the object prototype by the time napi_wrap() is called, napi_wrap() now inserts a new object (with the internal field) into the supplied object's prototype chain. Then it can be retrieved from there later by napi_unwrap(). This change also includes improvements to the documentation for napi_create_external(), partly to explain how it is different from napi_wrap(). Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13250 Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
-
JongChan Choi authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13323 Reviewed-By:
Luigi Pinca <luigipinca@gmail.com>
-
Jason Ginchereau authored
One of the N-API weak-reference test cases already had to be made asynchronous to handle different behavior in a newer V8 version: https://github.com/nodejs/node/pull/12864 When porting N-API to Node-ChakraCore, we found more of the test cases needed similar treatment: https://github.com/nodejs/node-chakracore/issues/246 So to make thes tests more robust (and avoid having differences in the test code for Node-ChakraCore), I am refactoring the tests in this file to insert a `setImmedate()` callback before every call to `gc()` and assertions about the effects of the GC. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13121 Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
-
Michael Dawson authored
Add testing for all types of typed arrays. Add testing for napi_is_arraybuffer. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13244 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Kunal Pathak <kunal.pathak@microsoft.com> Reviewed-By:
Hitesh Kanwathirtha <digitalinfinity@gmail.com>
-
Michael Dawson authored
Add napi_get_version function so that addons can query the level of N-API supported. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13207 Fixes: https://github.com/nodejs/abi-stable-node/issues/231 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>
-
Michael Dawson authored
Add test to cover napi_has_named_property Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13178 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com>
-
Daniel Bevenius authored
Really minor but I could not find an open PR for anything n-api where this could be changed, so creating this so that it is not forgotten. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13190 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Michael Dawson <mhdawson@ibm.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Michael Dawson authored
Add tests to validate that properties marked as static are available through the class as opposed to instances Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13124 Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Hitesh Kanwathirtha <digitalinfinity@gmail.com>
-
Michael Dawson authored
Fix mismatch in title for napi_get_value_string_utf16 Fixes: https://github.com/nodejs/abi-stable-node/issues/243 Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13123 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Refael Ackermann <refack@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com>
-
Michael Dawson authored
Realized that we don't actually point people to the file to include in order to access N-API functions. Add that. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13084 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net>
-
Jason Ginchereau authored
Unlike most N-API functions, `napi_get_last_error_info()` should not clear the last error code when successful, because a pointer to (not a copy of) the error info structure is returned via an out parameter. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13087 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
-
Michael Dawson authored
- add coverage for napi_get_prototype - add coverage for napi_strict_equals Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13044 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com>
-
Anna Henningsen authored
`TryCatch` without an `Isolate*` argument is deprecated, so add one. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13014 Reviewed-By:
Timothy Gu <timothygu99@gmail.com> Reviewed-By:
Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com>
-
Michael Dawson authored
Add tests to cover functions that return globals Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/13006 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com>
-
Michael Dawson authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/12974 Reviewed-By:
Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By:
Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Jason Ginchereau <jasongin@microsoft.com>
-
Rich Trott authored
Use `common.mustCall()` to confirm that function is invoked. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/12959 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By:
Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Beth Griggs authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/12898 Fixes: https://github.com/nodejs/node/issues/7129 Reviewed-By:
Sam Roberts <vieuxtech@gmail.com> Reviewed-By:
Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By:
Refael Ackermann <refack@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:
Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By:
Timothy Gu <timothygu99@gmail.com> Reviewed-By:
Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
-
Michael Dawson authored
- add coverage for napi_has_element - add coverage for napi_create_array_with_length Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/12890 Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Michael Dawson authored
- fix 2 broken links - fix capitalization in description of napi_create_array-with-length Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/12889 Reviewed-By:
Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By:
Refael Ackermann <refack@gmail.com> Reviewed-By:
Colin Ihrig <cjihrig@gmail.com> Reviewed-By:
Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By:
MichaëZasso <targos@protonmail.com> Reviewed-By:
Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By:
Hitesh Kanwathirtha <digitalinfinity@gmail.com>
-
Jason Ginchereau authored
- Create a handle scope before invoking the async completion callback, because it is basically always needed, easy for user code to forget, and this makes it more consistent with ordinary N-API function callbacks. - Check for an unhandled JS exception after invoking an async completion callback, and report it via `node::FatalException()`. - Add a corresponding test case for an exception in async callback. Previously, any unhandled JS exception thrown from a `napi_async_complete_callback` would be silently ignored. Among other things this meant assertions in some test cases could be undetected. Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/12838 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By:
James M Snell <jasnell@gmail.com>
-
Jason Ginchereau authored
When the number of args requested is greater than the actual number of args supplied to the function call, the remainder of the args array should be filled in with `undefined` values. Because of this bug, the remainder of the array was left uninitialized, which could cause a crash. Refer to the documentation for the `argv` parameter at https://github.com/nodejs/node/blob/master/doc/api/n-api.md#napi_get_cb_info Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/12863 Reviewed-By:
Anna Henningsen <anna@addaleax.net> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
-
Michaël Zasso authored
Backport-PR-URL: https://github.com/nodejs/node/pull/19447 PR-URL: https://github.com/nodejs/node/pull/12864 Ref: https://github.com/nodejs/node/pull/12551#issuecomment-297949361 Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
-