-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
[6.x] n-api: backport to v6.x #19447
[6.x] n-api: backport to v6.x #19447
Commits on Apr 10, 2018
-
n-api: add support for abi stable module API
Add support for abi stable module API (N-API) as "Experimental feature". The goal of this API is to provide a stable Node API for native module developers. N-API aims to provide ABI compatibility guarantees across different Node versions and also across different Node VMs - allowing N-API enabled native modules to just work across different versions and flavors of Node.js without recompilation. A more detailed introduction is provided in: https://github.com/nodejs/node-eps/blob/master/005-ABI-Stable-Module-API.md and https://github.com/nodejs/abi-stable-node/blob/doc/VM%20Summit.pdf. The feature, during its experimental state, will be guarded by a runtime flag "--napi-modules". Only when this flag is added to the command line will N-API modules along with regular non N-API modules be supported. The API is defined by the methods in "src/node_api.h" and "src/node_api_types.h". This is the best starting point to review the API surface. More documentation will follow. In addition to the implementation of the API using V8, which is included in this PR, the API has also been validated against chakracore and that port is available in https://github.com/nodejs/abi-stable-node/tree/api-prototype-chakracore-8.x. The current plan is to provide N-API support in versions 8.X and 6.X directly. For older versions, such as 4.X or pre N-API versions of 6.X, we plan to create an external npm module to provide a migration path that will allow modules targeting older Node.js versions to use the API, albeit without getting the advantage of not having to recompile. In addition, we also plan an external npm package with C++ sugar to simplify the use of the API. The sugar will be in-line only and will only use the exported N-API methods but is not part of the N-API itself. The current version is in: https://github.com/nodejs/node-api. This PR is a result of work in the abi-stable-node repo: https://github.com/nodejs/abi-stable-node/tree/doc, with this PR being the cumulative work on the api-prototype-8.x branch with the following contributors in alphabetical order: Author: Arunesh Chandra <[email protected]> Author: Gabriel Schulhof <[email protected]> Author: Hitesh Kanwathirtha <[email protected]> Author: Ian Halliday <[email protected]> Author: Jason Ginchereau <[email protected]> Author: Michael Dawson <[email protected]> Author: Sampson Gao <[email protected]> Author: Taylor Woll <[email protected]> PR-URL: nodejs#11975 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 146f554 - Browse repository at this point
Copy the full SHA 146f554View commit details -
n-api: break dep between v8 and napi attributes
The v8 n-api implementation had been depending on a one-to-one relationship between v8 and n-api v8 property attributes. Remove this dependency and fix coverity scan issue 165845. PR-URL: nodejs#12191 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Timothy Gu <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7a43dd2 - Browse repository at this point
Copy the full SHA 7a43dd2View commit details -
napi: supress invalid coverity leak message
Coverity was complaining that finalizer was being leaked in this method, however it should be freed when the buffer is finalized so I believe the message is invalid. Add the required comments to suppress the warning. PR-URL: nodejs#12192 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Hitesh Kanwathirtha <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6244224 - Browse repository at this point
Copy the full SHA 6244224View commit details -
n-api: create napi_env as a real structure
1. We define struct napi_env__ to include the isolate, the last exception, and the info about the last error. 2. We instantiate one struct napi_env__ during module registration and we pass it into the FunctionCallbackInfo for all subsequent entries into N-API when we create functions/accessors/finalizers. Once module unloading will be supported we shall have to delete the napi_env we create during module init. There is a clear separation between public and private API wrt. env: 1. Public APIs assert that env is not nullptr as their first action. 2. Private APIs need not validate env. They assume it's not nullptr. PR-URL: nodejs#12195 Fixes: nodejs/abi-stable-node#198 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for 69fe5ae - Browse repository at this point
Copy the full SHA 69fe5aeView commit details -
n-api: Update property attrs enum to match JS spec
The napi_property_attributes enum used names and values from v8::PropertyAttribute, but those negative flag names were outdated along with the default behavior of a property being writable, enumerable, and configurable unless otherwise specified. To match the ES5 standard property descriptor those attributes should be positive flags and should default to false unless otherwise specified. PR-URL: nodejs#12240 Fixes: nodejs/abi-stable-node#221 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Timothy Gu <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8047b41 - Browse repository at this point
Copy the full SHA 8047b41View commit details -
n-api: cache Symbol.hasInstance
This improves the performance of napi_instanceof() by retrieving Symbol.hasInstance from the global object once and then storing a persistent reference to it in the env. PR-URL: nodejs#12246 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for 7afb3bc - Browse repository at this point
Copy the full SHA 7afb3bcView commit details -
napi: initialize and check status properly
Initialize status to napi_generic_failure and only check it after having made an actual N-API call. This fixes up 8fbace1. PR-URL: nodejs#12283 Ref: nodejs#12279 Reviewed-By: Refael Ackermann <[email protected]>
Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for 1459aea - Browse repository at this point
Copy the full SHA 1459aeaView commit details -
n-api: change napi_callback to return napi_value
Change `napi_callback` to return `napi_value` directly instead of requiring `napi_set_return_value`. When we invoke the callback, we will check the return value and call `SetReturnValue` ourselves. If the callback returns `NULL`, we don't set the return value in v8 which would have the same effect as previously if the callback didn't call `napi_set_return_value`. Seems to be a more natural way to handle return values from callbacks. As a consequence, remove `napi_set_return_value`. Add a `napi_value` to `napi_property_descriptor` to support string values which couldn't be passed in the `utf8name` parameter or symbols as property names. Class names, however, cannot be symbols so this `napi_value` must be a string type in that case. Remove all of the `napi_callback_info` helpers except for `napi_get_cb_info` and make all the parameters to `napi_get_cb_info` optional except for argc. Update all the test collateral according to these changes. Also add `test/addons-napi/common.h` to house some common macros for wrapping N-API calls and error handling. PR-URL: nodejs#12248 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 630b4bf - Browse repository at this point
Copy the full SHA 630b4bfView commit details -
n-api: implement async helper methods
Based on the async methods we had in abi-stable-node before the napi feature landed in node/master. Changed this set of APIs to handle error cases and removed a lot of the extra methods we had for setting all the pieces of napi_work opting instead to pass all of those as arguments to napi_create_async_work as none of those parameters are optional except for the complete callback, anyway. Renamed the napi_work struct to napi_async_work and replace the struct itself with a class which can better encapsulate the object lifetime and uv_work_t that we're trying to wrap anyway. Added a napi_async_callback type for the async helper callbacks instead of taking raw function pointers and make this callback take a napi_env parameter as well as the void* data it was already taking. Call the complete handler for the async work item with a napi_status code translated from the uvlib error code. The execute callback is required for napi_create_async_work, though complete callback is still optional. Also added some async unit tests for addons-napi based on the addons/async_hello_world test. PR-URL: nodejs#12250 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Hitesh Kanwathirtha <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 257b28c - Browse repository at this point
Copy the full SHA 257b28cView commit details -
n-api: fix -Wmismatched-tags compiler warning
`napi_env__` was declared as a struct in one place and a class in another. PR-URL: nodejs#12333 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e6055bb - Browse repository at this point
Copy the full SHA e6055bbView commit details -
test: improve test coverage for n-api
Add basic tests for handle scopes as code coverage reports that we are not covering these with the existing tests. PR-URL: nodejs#12327 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3e6db1f - Browse repository at this point
Copy the full SHA 3e6db1fView commit details -
test: add second argument to assert.throws
This adds RegExp or error constructor arguments to the remaining places where it is missing in preparation for the commit that will enforce the presence of at least two arguments. PR-URL: nodejs#12270 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a5d892d - Browse repository at this point
Copy the full SHA a5d892dView commit details -
test: fix compiler warning in n-api test
Missed in ca786c3. This does not actually affect the outcome because returning `nullptr` or `this` from a constructor has the same effect. PR-URL: nodejs#12318 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d26cbed - Browse repository at this point
Copy the full SHA d26cbedView commit details -
n-api: add string api for latin1 encoding
PR-URL: nodejs#12368 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
Sampson Gao authored and Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for 13261d9 - Browse repository at this point
Copy the full SHA 13261d9View commit details -
n-api: fix coverity scan report
Coverity was reporting _request.work_req as not being initialized. Add memset to ensure all of _request is initialized. PR-URL: nodejs#12365 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 89e816b - Browse repository at this point
Copy the full SHA 89e816bView commit details -
test: port test for make_callback to n-api
Improved test coverage for napi_make_callback by porting the existing addons/make_callback test to n-api PR-URL: nodejs#12409 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 476b4ff - Browse repository at this point
Copy the full SHA 476b4ffView commit details -
Revert "test: port test for make_callback to n-api"
This reverts commit 70b51c8. PR-URL: nodejs#12475 Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4414e2b - Browse repository at this point
Copy the full SHA 4414e2bView commit details -
n-api: remove napi_get_value_string_length()
This API doesn't serve much purpose, and is only likely to cause confusion and bugs. The intention was that this would return the number of characters in a string independent of encoding, but that's not generally useful. In almost all cases, one of the encoding-specific napi_get_value_string_* APIs is more correct. (Pass a null buffer if only the encoded length is desired.) Anyway the current implementation of napi_get_value_string_length() is technically wrong: it returns the number of 2-byte code units of the UTF-16 encoding, but there are actually some characters that are encoded as two UTF-16 code units. Note the JavaScript String.prototype.length property returns the number of UTF-16 code units, which may be different from the number of characters. So, getting the true character count is not common with JavaScript, and is probably best left to specialized internationalization libraries. PR-URL: nodejs#12496 Fixes: nodejs/abi-stable-node#226 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7a093c2 - Browse repository at this point
Copy the full SHA 7a093c2View commit details -
n-api: tighten null-checking and clean up last error
We left out null-checks for many of the parameters passed to our APIs. In particular, arguments of type `napi_value` were often accepted without a null-check, even though they should never be null. Additionally, many APIs simply returned `napi_ok` on success. This leaves in place an error that may have occurred in a previous N-API call. Others (those which perform `NAPI_PREAMBLE(env)` at the top) OTOH explicitly clear the last error before proceeding. With this modification all APIs explicitly clear the last error on success. Fixes: nodejs/abi-stable-node#227 PR-URL: nodejs#12539 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for 89e85e7 - Browse repository at this point
Copy the full SHA 89e85e7View commit details -
n-api: Enable scope and ref APIs during exception
N-API is somewhat strict about blocking calls to many APIs while there is a pending exception. The NAPI_PREAMBLE macro at the beginning of many API implementations checks for a pending exception. However, a subset of the APIs (which don't call back into JavaScript) still need to work while in a pending-exception state. This changes the reference APIs (equivalent to v8::Persistent) and handle scope APIs so that they can be used for cleanup up while an exception is pending. We may decide to similarly enable a few other APIs later, (which would be a non-breaking change) but we know at least these are needed now to unblock some specific scenarios. Fixes: nodejs/abi-stable-node#122 Fixes: nodejs/abi-stable-node#228 PR-URL: nodejs#12524 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gabriel Schulhof <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4653b67 - Browse repository at this point
Copy the full SHA 4653b67View commit details -
test: test doc'd napi_get_value_int32 behaviour
We chose to document this in the docs as there are different possible behaviours. Adding this test to validate that all vm implementations do it the same way. PR-URL: nodejs#12633 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f7488e7 - Browse repository at this point
Copy the full SHA f7488e7View commit details -
test: add coverage for napi_cancel_async_work
adding test coverage for napi_cancel_async_work based on coverage report PR-URL: nodejs#12575 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1afabfc - Browse repository at this point
Copy the full SHA 1afabfcView commit details -
n-api: Reference and external tests
- Add a test project to addons-napi that covers the N-API reference and external APIs - Fix a bug in napi_typeof that was found by the new tests PR-URL: nodejs#12551 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 624a448 - Browse repository at this point
Copy the full SHA 624a448View commit details -
n-api: Sync with back-compat changes
Background: To enable N-API support for node versions back to v4, the N-API code can also be built as an external addon. To make maintenance easier, a single codebase needs to support both built-in and external scenarios, along with Node versions >= 4 (and corresponding V8 versions). This change includes several minor fixes to avoid using node internal APIs and support older V8 versions: - Expand node::arraysize - In the CHECK_ENV() macro, return an error code instead of calling node::FatalError(). This is more consistent with how other invalid arguments to N-API functions are handled. - In v8impl::SetterCallbackWrapper::SetReturnValue(), do nothing instead of calling node::FatalError(). This is more consistent with JavaScript setter callbacks, where any returned value is silently ignored. - When queueing async work items, get the uv default loop instead of getting the loop from node::Environment::GetCurrent(). Currently that returns the same loop anyway. If/when node supports multiple environments, it should have a public API for getting the environment & event loop, and we can update this implementation then. - Use v8::Maybe::FromJust() instead of the newer alias ToChecked() PR-URL: nodejs#12674 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 406f4ce - Browse repository at this point
Copy the full SHA 406f4ceView commit details -
doc: Add initial documentation for N-API
Add the initial documentation for the N-API This PR is a result of work in the abi-stable-node repo: https://github.com/nodejs/abi-stable-node/tree/doc, with this PR being the cumulative work on the documentation sections in that repo with the following contributors in alphabetical order: Author: Arunesh Chandra <[email protected]> Author: Gabriel Schulhof <[email protected]> Author: Hitesh Kanwathirtha <[email protected]> Author: Jason Ginchereau <[email protected]> Author: Michael Dawson <[email protected]> Author: Sampson Gao <[email protected]> Author: Taylor Woll <[email protected]> PR-URL: nodejs#12549 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9189c86 - Browse repository at this point
Copy the full SHA 9189c86View commit details -
test: replace indexOf with includes
Start the transition to Array.prototype.includes() and String.prototype.includes(). This commit refactors most of the comparisons of Array.prototype.indexOf() and String.prototype.indexOf() return values with -1 to the former methods in tests. PR-URL: nodejs#12604 Refs: nodejs#12586 Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3461bc1 - Browse repository at this point
Copy the full SHA 3461bc1View commit details -
test,lib,doc: use function declarations
Replace function expressions with function declarations in preparation for a lint rule requiring function declarations. PR-URL: nodejs#12711 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b91ac10 - Browse repository at this point
Copy the full SHA b91ac10View commit details -
n-api: remove unnecessary try-catch bracket from certain APIs
These APIs do not need a try-catch around their body, because no exceptions are thrown in their implementation: - `napi_is_array()` - `napi_get_value_string_latin1()` - `napi_get_value_string_utf8()` - `napi_get_value_string_utf16()` - `napi_get_value_external()` - `napi_is_buffer()` - `napi_is_arraybuffer()` - `napi_get_arraybuffer_info()` - `napi_is_typedarray()` - `napi_get_typedarray_info()` Fixes: nodejs/abi-stable-node#238 PR-URL: nodejs#12705 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for e89a911 - Browse repository at this point
Copy the full SHA e89a911View commit details -
test: fix warning in n-api reference test
Add cast to avoid warning during build of addon. PR-URL: nodejs#12730 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f14a0bb - Browse repository at this point
Copy the full SHA f14a0bbView commit details -
test: add coverage for error apis
Add coverage for N-API functions related to throwing and creating errors. A number of these are currently showing as not having any coverage in the nightly code coverage reports. PR-URL: nodejs#12729 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 269e921 - Browse repository at this point
Copy the full SHA 269e921View commit details -
test: port test for make_callback to n-api
Improved test coverage for napi_make_callback by porting the existing addons/make_callback test to n-api PR-URL: nodejs#12409 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ed2ef69 - Browse repository at this point
Copy the full SHA ed2ef69View commit details -
test: fix napi test_reference for recent V8
PR-URL: nodejs#12864 Ref: nodejs#12551 (comment) Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7491cee - Browse repository at this point
Copy the full SHA 7491ceeView commit details -
n-api: napi_get_cb_info should fill array
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 PR-URL: nodejs#12863 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 61992ff - Browse repository at this point
Copy the full SHA 61992ffView commit details -
n-api: Handle fatal exception in async callback
- 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. PR-URL: nodejs#12838 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 184ffb5 - Browse repository at this point
Copy the full SHA 184ffb5View commit details -
doc: fix broken links in n-api doc
- fix 2 broken links - fix capitalization in description of napi_create_array-with-length PR-URL: nodejs#12889 Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: MichaëZasso <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Hitesh Kanwathirtha <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b69818d - Browse repository at this point
Copy the full SHA b69818dView commit details -
test: improve n-api array func coverage
- add coverage for napi_has_element - add coverage for napi_create_array_with_length PR-URL: nodejs#12890 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 17d8b55 - Browse repository at this point
Copy the full SHA 17d8b55View commit details -
doc: clarify node.js addons are c++
PR-URL: nodejs#12898 Fixes: nodejs#7129 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ce0e121 - Browse repository at this point
Copy the full SHA ce0e121View commit details -
test: add common.mustCall() to NAPI exception test
Use `common.mustCall()` to confirm that function is invoked. PR-URL: nodejs#12959 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bdd1375 - Browse repository at this point
Copy the full SHA bdd1375View commit details -
doc: clarify operation of napi_cancel_async_work
PR-URL: nodejs#12974 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ba2594e - Browse repository at this point
Copy the full SHA ba2594eView commit details -
test: improve N-API test coverage
Add tests to cover functions that return globals PR-URL: nodejs#13006 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 67e0372 - Browse repository at this point
Copy the full SHA 67e0372View commit details -
n-api: remove compiler warning
`TryCatch` without an `Isolate*` argument is deprecated, so add one. PR-URL: nodejs#13014 Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d572c9c - Browse repository at this point
Copy the full SHA d572c9cView commit details -
test: Improve N-API test coverage
- add coverage for napi_get_prototype - add coverage for napi_strict_equals PR-URL: nodejs#13044 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b10fe3e - Browse repository at this point
Copy the full SHA b10fe3eView commit details -
n-api: Retain last code when getting error info
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. PR-URL: nodejs#13087 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 726d584 - Browse repository at this point
Copy the full SHA 726d584View commit details -
doc: add reference to node_api.h in docs
Realized that we don't actually point people to the file to include in order to access N-API functions. Add that. PR-URL: nodejs#13084 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f7232ad - Browse repository at this point
Copy the full SHA f7232adView commit details -
doc: fix title/function name mismatch
Fix mismatch in title for napi_get_value_string_utf16 Fixes: nodejs/abi-stable-node#243 PR-URL: nodejs#13123 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2e48f58 - Browse repository at this point
Copy the full SHA 2e48f58View commit details -
test: increase n-api constructor coverage
Add tests to validate that properties marked as static are available through the class as opposed to instances PR-URL: nodejs#13124 Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Hitesh Kanwathirtha <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4d730be - Browse repository at this point
Copy the full SHA 4d730beView commit details -
src: correct endif comment SRC_NODE_API_H__
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. PR-URL: nodejs#13190 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 278ba33 - Browse repository at this point
Copy the full SHA 278ba33View commit details -
test: add coverage for napi_has_named_property
Add test to cover napi_has_named_property PR-URL: nodejs#13178 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 54bd4b5 - Browse repository at this point
Copy the full SHA 54bd4b5View commit details -
Add napi_get_version function so that addons can query the level of N-API supported. PR-URL: nodejs#13207 Fixes: nodejs/abi-stable-node#231 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5c0c021 - Browse repository at this point
Copy the full SHA 5c0c021View commit details -
test: improve n-api coverage for typed arrays
Add testing for all types of typed arrays. Add testing for napi_is_arraybuffer. PR-URL: nodejs#13244 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Kunal Pathak <[email protected]> Reviewed-By: Hitesh Kanwathirtha <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5c19e28 - Browse repository at this point
Copy the full SHA 5c19e28View commit details -
test: Make N-API weak-ref GC tests asynchronous
One of the N-API weak-reference test cases already had to be made asynchronous to handle different behavior in a newer V8 version: nodejs#12864 When porting N-API to Node-ChakraCore, we found more of the test cases needed similar treatment: nodejs/node-chakracore#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. PR-URL: nodejs#13121 Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8653a1b - Browse repository at this point
Copy the full SHA 8653a1bView commit details -
PR-URL: nodejs#13323 Reviewed-By: Luigi Pinca <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 897bac2 - Browse repository at this point
Copy the full SHA 897bac2View commit details -
n-api: enable napi_wrap() to work with any object
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(). PR-URL: nodejs#13250 Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2249581 - Browse repository at this point
Copy the full SHA 2249581View commit details -
test: consolidate n-api test addons
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. PR-URL: nodejs#13317 Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2052c6a - Browse repository at this point
Copy the full SHA 2052c6aView commit details -
test: consolidate n-api test addons - part2
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. PR-URL: nodejs#13380 Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d572b0f - Browse repository at this point
Copy the full SHA d572b0fView commit details -
test: fix build warning in addons-napi/test_object
PR-URL: nodejs#13412 Reviewed-By: Anna Henningsen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 28cf8f0 - Browse repository at this point
Copy the full SHA 28cf8f0View commit details -
doc: add ref to option to enable n-api
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. PR-URL: nodejs#13406 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießn <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 45be27f - Browse repository at this point
Copy the full SHA 45be27fView commit details -
doc: fix typo "ndapi" in n-api.md
PR-URL: nodejs#13484 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Jamen Marz authored and Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for 8a96551 - Browse repository at this point
Copy the full SHA 8a96551View commit details -
doc: fix out of date sections in n-api doc
PR-URL: nodejs#13508 Fixes: nodejs#13469 Fixes: nodejs#13458 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 01302b1 - Browse repository at this point
Copy the full SHA 01302b1View commit details -
test: add coverage for napi_property_descriptor
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. PR-URL: nodejs#13510 Reviewed-By: Jason Ginchereau <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 02e7b63 - Browse repository at this point
Copy the full SHA 02e7b63View commit details -
doc: fix napi_create_*_error signatures in n-api
PR-URL: nodejs#13544 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna M. Kedzierska <[email protected]> Reviewed-By: Chris Dickinson <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2ff7692 - Browse repository at this point
Copy the full SHA 2ff7692View commit details -
doc: fix out of date napi_callback doc
The earlier version `napi_callback` returns `void` but now is `napi_value`. The document of this section hasn't been modified. PR-URL: nodejs#13570 Fixes: nodejs#12248 Fixes: nodejs#13562 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2b94a31 - Browse repository at this point
Copy the full SHA 2b94a31View commit details -
doc: fix a few n-api doc issues
- 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. PR-URL: nodejs#13650 Fixes: nodejs#13555 Fixes: nodejs#13556 Fixes: nodejs#13562 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: Ingvar Stepanyan <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 00ee027 - Browse repository at this point
Copy the full SHA 00ee027View commit details -
n-api: avoid crash in napi_escape_scope()
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. PR-URL: nodejs#13651 Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f680c08 - Browse repository at this point
Copy the full SHA f680c08View commit details -
doc: doc lifetime of n-api last error info
Document the lifetime of the structure returned by napi_get_last_error_info PR-URL: nodejs#13939 Fixes: nodejs/abi-stable-node#251 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Hitesh Kanwathirtha <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 512fc32 - Browse repository at this point
Copy the full SHA 512fc32View commit details -
PR-URL: nodejs#13972 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 947b1cd - Browse repository at this point
Copy the full SHA 947b1cdView commit details -
test: verify napi_get_property() walks prototype
Refs: nodejs#13925 PR-URL: nodejs#13961 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 922ea46 - Browse repository at this point
Copy the full SHA 922ea46View commit details -
n-api: add napi_delete_element()
Refs: nodejs#13924 PR-URL: nodejs#13949 Reviewed-By: Jason Ginchereau <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ae0bdd5 - Browse repository at this point
Copy the full SHA ae0bdd5View commit details -
n-api: add napi_delete_property()
Fixes: nodejs#13924 PR-URL: nodejs#13934 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 22b9a87 - Browse repository at this point
Copy the full SHA 22b9a87View commit details -
n-api: use Maybe version of Object::SetPrototype()
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); PR-URL: nodejs#14053 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c95b561 - Browse repository at this point
Copy the full SHA c95b561View commit details -
n-api: fix -Wmaybe-uninitialized compiler warning
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. PR-URL: nodejs#14053 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c5c580c - Browse repository at this point
Copy the full SHA c5c580cView commit details -
test: add coverage for napi_typeof
We had some, but not complete coverage indirectly through other tests. Add test to validate it specifically and covers cases that were not being covered. PR-URL: nodejs#13990 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 134d7a1 - Browse repository at this point
Copy the full SHA 134d7a1View commit details -
N-API: Reuse ObjectTemplate instances
V8 caches and does not subsequently release `ObjectTemplate` instances. Thus, we need to store the `ObjectTemplate` from which we derive object instances we use for `napi_wrap()` and function/accessor context in a persistent in the `napi_env`. nodejs/node-addon-api#70 (comment) PR-URL: nodejs#13999 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Hitesh Kanwathirtha <[email protected]>
Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for 35b3c61 - Browse repository at this point
Copy the full SHA 35b3c61View commit details -
n-api: add napi_has_own_property()
Refs: nodejs#13925 PR-URL: nodejs#14063 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bb5a56e - Browse repository at this point
Copy the full SHA bb5a56eView commit details -
n-api: fix warning in test_general
Currently the following warning is issued when buildning: Building addon /work/nodejs/node/test/addons-napi/test_general/ CC(target) Debug/obj.target/test_general/test_general.o ../test_general.c:116:14: warning: variable 'result' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] } else if (argument_type == napi_null) { ^~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:119:10: note: uninitialized use occurs here return result; ^~~~~~ ../test_general.c:116:10: note: remove the 'if' if its condition is always true } else if (argument_type == napi_null) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../test_general.c:101:20: note: initialize the variable 'result' to silence this warning napi_value result; ^ = NULL This commit simply initializes result to NULL to avoid this warning. PR-URL: nodejs#14104 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c8ae23e - Browse repository at this point
Copy the full SHA c8ae23eView commit details -
n-api: Implement stricter wrapping
Use a stronger criterion to identify objects in the prototype chain that store pointers to native data that were added by previous calls to `napi_wrap()`. Whereas the old criterion for identifying `napi_wrap()`-injected prototype chain objects was to consider an object with an internal field count of 1 to be such an object, the new criterion is to consider an object with an internal field count of 2 such that the second field holds a `v8::External` which itself contains a pointer to a global static string unique to N-API to be a `napi_wrap()`-injected prototype chain object. This greatly reduces the possibility of returning a pointer that was not previously added with `napi_wrap()`, and it allows us to recognize that an object has already undergone `napi_wrap()` and we can thus prevent a chain of wrappers only the first of which is accessible from appearing in the prototype chain, as would be the result of multiple calls to `napi_wrap()` using the same object. PR-URL: nodejs#13872 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Timothy Gu <[email protected]>
Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for 99fc87e - Browse repository at this point
Copy the full SHA 99fc87eView commit details -
n-api: wrap test macros in do/while
PR-URL: nodejs#14095 Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1536f37 - Browse repository at this point
Copy the full SHA 1536f37View commit details -
test: handle missing V8 tests in n-api test
The N-API test testInstanceOf.js relies on several V8 test files which may not exist in downloadable archives. If the files are missing, this commit causes a warning to be emitted rather than failing the test. Refs: nodejs#14113 Fixes: nodejs#13344 PR-URL: nodejs#14123 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fb572c4 - Browse repository at this point
Copy the full SHA fb572c4View commit details -
n-api: add code parameter to error helpers
In support of the effort to add error codes to all errors generated by Node.js, add an optional code parameter to the helper functions used to throw/create errors in N-API. PR-URL: nodejs#13988 Fixes: nodejs#13933 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5278223 - Browse repository at this point
Copy the full SHA 5278223View commit details -
n-api: add napi_fatal_error API
PR-URL: nodejs#13971 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 25e46c5 - Browse repository at this point
Copy the full SHA 25e46c5View commit details -
test: replace string concat with template literal
Replace the string concat at test/addons-napi/test_reference/test.js. PR-URL: nodejs#14269 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bc83e71 - Browse repository at this point
Copy the full SHA bc83e71View commit details -
PR-URL: nodejs#14400 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e885661 - Browse repository at this point
Copy the full SHA e885661View commit details -
n-api: add fast paths for integer getters
Ref: nodejs#14379 PR-URL: nodejs#14393 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 55e3ca8 - Browse repository at this point
Copy the full SHA 55e3ca8View commit details -
n-api: directly create Local from Persistent
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. PR-URL: nodejs#14211 Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 39ce757 - Browse repository at this point
Copy the full SHA 39ce757View commit details -
test: changed error message validator
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. PR-URL: nodejs#14443 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8fab9bc - Browse repository at this point
Copy the full SHA 8fab9bcView commit details -
n-api: re-use napi_env between modules
Store the `napi_env` on the global object at a private key. This gives us one `napi_env` per context. Refs: nodejs#14367 PR-URL: nodejs#14217 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Timothy Gu <[email protected]>
Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for b5ef731 - Browse repository at this point
Copy the full SHA b5ef731View commit details -
n-api: add support for DataView
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(). PR-URL: nodejs#14382 Fixes: nodejs#13926 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1fe2004 - Browse repository at this point
Copy the full SHA 1fe2004View commit details -
doc: document napi_finalize() signature
Refs: nodejs#14138 PR-URL: nodejs#14230 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fb41b01 - Browse repository at this point
Copy the full SHA fb41b01View commit details -
src: replace assert with CHECK_LE in node_api.cc
PR-URL: nodejs#14514 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Tobias Nie�en <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3be9e95 - Browse repository at this point
Copy the full SHA 3be9e95View commit details -
n-api: optimize number API performance
- 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: nodejs#14379 PR-URL: nodejs#14573 Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2ae281e - Browse repository at this point
Copy the full SHA 2ae281eView commit details -
n-api: add napi_get_node_version
Add `napi_get_node_version`, to help with feature-detecting Node.js as an environment. PR-URL: nodejs#14696 Reviewed-By: Kyle Farnung <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 11427ca - Browse repository at this point
Copy the full SHA 11427caView commit details -
test: use regular expressions in throw assertions
Test errors thrown in addons-napi/test_constructor more specifically. PR-URL: nodejs#14318 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7ca8b1d - Browse repository at this point
Copy the full SHA 7ca8b1dView commit details -
PR-URL: nodejs#14707 Refs: nodejs#12756 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ca8eaa2 - Browse repository at this point
Copy the full SHA ca8eaa2View commit details -
doc: added napi_get_value_string_latin1
* Reordered string functions alphabetically * Fixed a typo in napi_get_value_string_utf8 PR-URL: nodejs#14678 Fixes: nodejs#14397 Refs: nodejs#14256 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Timothy Gu <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b0abcbf - Browse repository at this point
Copy the full SHA b0abcbfView commit details -
n-api: add ability to remove a wrapping
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. PR-URL: nodejs#14658 Reviewed-By: Michael Dawson <[email protected]> Fixes: nodejs/abi-stable-node#266
Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for f3a8d0a - Browse repository at this point
Copy the full SHA f3a8d0aView commit details -
doc: fix doc for napi_get_value_string_utf8
The API for napi_get_value_string_utf8() appears to have been previously changed. This improves the doc reflect the current design. PR-URL: nodejs#14529 Fixes: nodejs#14398 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Daniel Taveras authored and Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for 41b7f4c - Browse repository at this point
Copy the full SHA 41b7f4cView commit details -
test: remove unused parameters
PR-URL: nodejs#14968 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Kunal Pathak <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: David Cai <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6ec485a - Browse repository at this point
Copy the full SHA 6ec485aView commit details -
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. PR-URL: nodejs#14365 Fixes: nodejs/abi-stable-node#242 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]>
Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for 2bab64e - Browse repository at this point
Copy the full SHA 2bab64eView commit details -
n-api: adds function to adjust external memory
Added a wrapper around v8::Isolate::AdjustAmountOfExternalAllocatedMemory PR-URL: nodejs#14310 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Fixes: nodejs#13928
Chris Young authored and Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for 28786e2 - Browse repository at this point
Copy the full SHA 28786e2View commit details -
n-api: implement napi_run_script
Fixes: nodejs/abi-stable-node#51 PR-URL: nodejs#15216 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected] Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Timothy Gu <[email protected]>
Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for 32504e1 - Browse repository at this point
Copy the full SHA 32504e1View commit details -
n-api: stop creating references to primitives
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. PR-URL: nodejs#15289 Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Re: nodejs/node-chakracore#380
Gabriel Schulhof committedApr 10, 2018 Configuration menu - View commit details
-
Copy full SHA for 63e8605 - Browse repository at this point
Copy the full SHA 63e8605View commit details -
n-api: use AsyncResource for Work tracking
Enable combining N-API async work with async-hooks. PR-URL: nodejs#14697 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9c68371 - Browse repository at this point
Copy the full SHA 9c68371View commit details
Commits on Apr 16, 2018
-
n-api: change async resource name to napi_value
PR-URL: nodejs#14697 Reviewed-By: Anna Henningsen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 14dc0f8 - Browse repository at this point
Copy the full SHA 14dc0f8View commit details -
n-api: refactor napi_addon_register_func
As per discussion in abi-stable-node: nodejs/abi-stable-node#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. PR-URL: nodejs#15088 Reviewed-By: Gabriel Schulhof <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Hitesh Kanwathirtha <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ab1870a - Browse repository at this point
Copy the full SHA ab1870aView commit details -
n-api: Context for custom async operations
- 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. PR-URL: nodejs#15189 Fixes: nodejs#13254 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for edfbc5b - Browse repository at this point
Copy the full SHA edfbc5bView commit details -
n-api: napi_is_construct_call->napi_get_new_target
Remove napi_is_construct_call and introduce napi_get_new_target. PR-URL: nodejs#14698 Reviewed-By: Jason Ginchereau <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Kyle Farnung <[email protected]>
Sampson Gao authored and Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for 574f09e - Browse repository at this point
Copy the full SHA 574f09eView commit details -
n-api: add optional string length parameters
PR-URL: nodejs#15343 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
Sampson Gao authored and Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for 7fb617b - Browse repository at this point
Copy the full SHA 7fb617bView commit details -
n-api: remove n-api module loading flag
Remove the command line flag that was needed for N-API module loading. Re: nodejs/vm#9 PR-URL: nodejs#14902 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Hitesh Kanwathirtha <[email protected]>
Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for a61dd4b - Browse repository at this point
Copy the full SHA a61dd4bView commit details -
PR-URL: nodejs#15449 Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ccc321d - Browse repository at this point
Copy the full SHA ccc321dView commit details -
n-api: fix warning about size_t compare with int
PR-URL: nodejs#15508 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Sampson Gao authored and Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for 3f8e900 - Browse repository at this point
Copy the full SHA 3f8e900View commit details -
doc: fix outdated code sample in n-api.md
code samples of napi_create_object and napi_property_descriptor were not updated to latest API. PR-URL: nodejs#15581 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c683497 - Browse repository at this point
Copy the full SHA c683497View commit details -
n-api: add check for large strings
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. PR-URL: nodejs#15611 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7e6c9f1 - Browse repository at this point
Copy the full SHA 7e6c9f1View commit details -
PR-URL: nodejs#15953 Reviewed-By: Ruben Bridgewater <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1b2c2a9 - Browse repository at this point
Copy the full SHA 1b2c2a9View commit details -
test: fix race condition in addon test
PR-URL: nodejs#16037 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f589058 - Browse repository at this point
Copy the full SHA f589058View commit details -
test: cleaned up assert messages
PR-URL: nodejs#16032 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b225e66 - Browse repository at this point
Copy the full SHA b225e66View commit details -
n-api: make changes for source compatibility
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. PR-URL: nodejs#16102 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for 2e2b48b - Browse repository at this point
Copy the full SHA 2e2b48bView commit details -
n-api,test: use module name macro
test_constructor_name.c should use NODE_GYP_MODULE_NAME. PR-URL: nodejs#16146 Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Evan Lucas <[email protected]>
Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for 45205f0 - Browse repository at this point
Copy the full SHA 45205f0View commit details -
test: remove redundant error messages
Remove redundant error messages for assert.strictEqual() PR-URL: nodejs#16043 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Christina Chan authored and Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for ae88690 - Browse repository at this point
Copy the full SHA ae88690View commit details -
PR-URL: nodejs#16202 Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 239859f - Browse repository at this point
Copy the full SHA 239859fView commit details -
doc: update to use NAPI_AUTO_LENGTH
Update so that doc says to use NAPI_AUTO_LENGTH instead of -1 to indicate null terminate string. PR-URL: nodejs#16187 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6456daf - Browse repository at this point
Copy the full SHA 6456dafView commit details -
Update tests to use module name macro PR-URL: nodejs#16185 Reviewed-By: Gabriel Schulhof <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a20e0d5 - Browse repository at this point
Copy the full SHA a20e0d5View commit details -
n-api: check against invalid handle scope usage
Fixes: nodejs#16175 PR-URL: nodejs#16201 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 96d1334 - Browse repository at this point
Copy the full SHA 96d1334View commit details -
n-api: unexpose symbols and remove EXTERNAL_NAPI
* 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. PR-URL: nodejs#16234 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for dd2a60e - Browse repository at this point
Copy the full SHA dd2a60eView commit details -
test: improve message for assert.strictEqual()
PR-URL: nodejs#16013 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e2b58ab - Browse repository at this point
Copy the full SHA e2b58abView commit details -
test: include actual value in assertion message
PR-URL: nodejs#15935 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6674c17 - Browse repository at this point
Copy the full SHA 6674c17View commit details -
test: use default assertion messages
The string literal messages in addons-napi/test_buffer/test.js are less helpful than the default messages, so use the default messages. PR-URL: nodejs#16808 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ec2c784 - Browse repository at this point
Copy the full SHA ec2c784View commit details -
test: add detailed message for assertion failure
PR-URL: nodejs#16812 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4c8826f - Browse repository at this point
Copy the full SHA 4c8826fView commit details -
test: improve assert messages in napi exception test
Include unexpected value in assertion messages. PR-URL: nodejs#16820 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cc202a5 - Browse repository at this point
Copy the full SHA cc202a5View commit details -
doc: fix a typo in n-api documentation
PR-URL: nodejs#16879 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bfeeeb3 - Browse repository at this point
Copy the full SHA bfeeeb3View commit details -
test: improve error emssage reporting in testNapiRun.js
PR-URL: nodejs#16821 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Paul Ashfield authored and Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for ab95aa4 - Browse repository at this point
Copy the full SHA ab95aa4View commit details -
PR-URL: nodejs#16911 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f3cfc2f - Browse repository at this point
Copy the full SHA f3cfc2fView commit details -
test: refactor addons-napi/test_promise/test.js
* remove custom messages for assert that conceal values * add comment explaining test * add block scoping PR-URL: nodejs#16814 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c15b4ee - Browse repository at this point
Copy the full SHA c15b4eeView commit details -
doc: document common pattern for instanceof checks
PR-URL: nodejs#16699 Fixes: nodejs#13824 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f450931 - Browse repository at this point
Copy the full SHA f450931View commit details -
n-api: add helper for addons to get the event loop
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. PR-URL: nodejs#17109 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d21b9a5 - Browse repository at this point
Copy the full SHA d21b9a5View commit details -
src: add napi_handle_scope_mismatch to msg list
PR-URL: nodejs#17161 Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
neta authored and Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for c04169d - Browse repository at this point
Copy the full SHA c04169dView commit details -
doc: use "JavaScript" instead of "Javascript"
PR-URL: nodejs#17163 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 32dd8f1 - Browse repository at this point
Copy the full SHA 32dd8f1View commit details -
n-api: use nullptr instead of NULL in node_api.cc
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. PR-URL: nodejs#17276 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Lance Ball <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: MichaëZasso <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 45a3e6b - Browse repository at this point
Copy the full SHA 45a3e6bView commit details -
doc: update example in module registration
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 <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d9dc130 - Browse repository at this point
Copy the full SHA d9dc130View commit details -
test: replace assert.throws with common.expectsError
PR-URL: nodejs#17445 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3f4ac09 - Browse repository at this point
Copy the full SHA 3f4ac09View commit details -
test: add unhandled rejection guard
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. PR-URL: nodejs#17275 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a005c30 - Browse repository at this point
Copy the full SHA a005c30View commit details -
test: remove literals that obscure assert messages
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. PR-URL: nodejs#17642 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2515f51 - Browse repository at this point
Copy the full SHA 2515f51View commit details -
n-api: fix memory leak in napi_async_destroy()
PR-URL: nodejs#17714 Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: James M Snell <[email protected]>
alnyan authored and Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for 825468f - Browse repository at this point
Copy the full SHA 825468fView commit details -
test: remove ambiguous error messages from test_error
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. PR-URL: nodejs#17812 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6d5b622 - Browse repository at this point
Copy the full SHA 6d5b622View commit details -
doc: updates examples to use NULL
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. PR-URL: nodejs#18008 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 968d757 - Browse repository at this point
Copy the full SHA 968d757View commit details -
n-api: throw RangeError in napi_create_dataview() with invalid range
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 PR-URL: nodejs#17869 Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2f92a07 - Browse repository at this point
Copy the full SHA 2f92a07View commit details -
n-api: expose n-api version in process.versions
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. PR-URL: nodejs#18067 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Tobias Nießn <[email protected]> Reviewed-By: Richard Lau <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9dc08ae - Browse repository at this point
Copy the full SHA 9dc08aeView commit details -
doc: napi: fix unbalanced emphasis
Some of the section headers had unbalanced emphasis. PR-URL: nodejs#18122 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Kyle Farnung <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for edb244f - Browse repository at this point
Copy the full SHA edb244fView commit details -
doc: napi: make header style consistent
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. PR-URL: nodejs#18122 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Kyle Farnung <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 85b964b - Browse repository at this point
Copy the full SHA 85b964bView commit details -
n-api: throw RangeError napi_create_typedarray()
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 PR-URL: nodejs#18037 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5d06fab - Browse repository at this point
Copy the full SHA 5d06fabView commit details -
test: fixed typos in napi test
PR-URL: nodejs#18148 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e32cca2 - Browse repository at this point
Copy the full SHA e32cca2View commit details -
doc: remove uannecessary Require
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 PR-URL: nodejs#18184 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 91c9e19 - Browse repository at this point
Copy the full SHA 91c9e19View commit details -
test: refactor addons-napi/test_exception/test.js
* provide block scoping to prevent unintended side effects * remove confusing and unnecessary assertion message * use consisitent `actual, expected` argument order for assertions PR-URL: nodejs#18340 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f103e21 - Browse repository at this point
Copy the full SHA f103e21View commit details -
n-api: change assert ok check to notStrictEqual.
PR-URL: nodejs#18414 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0fd8ceb - Browse repository at this point
Copy the full SHA 0fd8cebView commit details -
test: show pending exception error in napi tests
Shows the result of the wasPending in the error message if the assertion fails. PR-URL: nodejs#18413 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e57f34c - Browse repository at this point
Copy the full SHA e57f34cView commit details -
n-api: implement wrapping using private properties
PR-URL: nodejs#18311 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Fixes: nodejs#14367
Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for 5c183d7 - Browse repository at this point
Copy the full SHA 5c183d7View commit details -
n-api: wrap control flow macro in do/while
Make CHECK_ENV() safe to use in the following context: if (condition) CHECK_ENV(env); else something_else(); PR-URL: nodejs#18532 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 76dfefa - Browse repository at this point
Copy the full SHA 76dfefaView commit details -
doc: remove usage of you in n-api doc
We avoid using 'you' in the documentation based on our guidelines. Remove usage in the n-api doc. PR-URL: nodejs#18528 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b7093fa - Browse repository at this point
Copy the full SHA b7093faView commit details -
PR-URL: nodejs#18555 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Evan Lucas <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ed7e64b - Browse repository at this point
Copy the full SHA ed7e64bView commit details -
n-api: add methods to open/close callback scope
Add support for the following methods; napi_open_callback_scope napi_close_callback_scope These are needed when running asynchronous methods directly using uv. PR-URL: nodejs#18089 Fixes: nodejs#15604 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 63d1f02 - Browse repository at this point
Copy the full SHA 63d1f02View commit details -
n-api: remove extra reference from test
PR-URL: nodejs#18542 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for d75fbeb - Browse repository at this point
Copy the full SHA d75fbebView commit details -
PR-URL: nodejs#18590 Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4753369 - Browse repository at this point
Copy the full SHA 4753369View commit details -
test: improve error message output
PR-URL: nodejs#18498 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c7f4a4f - Browse repository at this point
Copy the full SHA c7f4a4fView commit details -
test: convert new tests to use error types
PR-URL: nodejs#18581 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 85728d1 - Browse repository at this point
Copy the full SHA 85728d1View commit details -
doc: fix exporting a function example
Missing the length argument in napi_create_function. PR-URL: nodejs#18661 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
Aonghus O Nia authored and Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for 4950772 - Browse repository at this point
Copy the full SHA 4950772View commit details -
doc: mark NAPI_AUTO_LENGTH as code
PR-URL: nodejs#18697 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7996463 - Browse repository at this point
Copy the full SHA 7996463View commit details -
test: remove unnecessary timer
The timer in NAPI's test_callback_scope/test-resolve-async.js can be removed. If the test fails, it will timeout on its own. The extra timer increases the chances of the test being flaky. PR-URL: nodejs#18719 Fixes: nodejs#18702 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a12f442 - Browse repository at this point
Copy the full SHA a12f442View commit details -
Passing a pointer to a static integer is sufficient for the test. PR-URL: nodejs#19039 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Hitesh Kanwathirtha <[email protected]>
Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for 8786335 - Browse repository at this point
Copy the full SHA 8786335View commit details -
doc: fix n-api asynchronous threading docs
Documentation for N-API Custom Asynchronous Operations incorrectly stated that async execution happens on the main event loop. Added details to napi_create_async_work about which threads are used to invoke the execute and complete callbacks. Changed 'async' to 'asynchronous' in the documentation for Custom Asynchronous Operations. Changed "executes in parallel" to "can execute in parallel" for the documentation of napi_create_async_work execute parameter. PR-URL: nodejs#19073 Fixes: nodejs#19071 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0efd826 - Browse repository at this point
Copy the full SHA 0efd826View commit details -
Remove the necessity for allocating on the heap, and assert that the correct pointer gets passed to the finalizer. PR-URL: nodejs#19086 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for cab6ce9 - Browse repository at this point
Copy the full SHA cab6ce9View commit details -
Document which APIs work while an exception is pending. This is the list of all APIs which do not start with `NAPI_PREAMBLE(env)`. Fixes: nodejs/abi-stable-node#257 PR-URL: nodejs#19078 Reviewed-By: Michael Dawson <[email protected]>
Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for ab4763d - Browse repository at this point
Copy the full SHA ab4763dView commit details -
n-api: resolve promise in test
The last promise created by the test for the purposes of making sure that its type is indeed a promise needs to be resolved so as to avoid having it left in the pending state at the end of the test. PR-URL: nodejs#19245 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for a5ec82f - Browse repository at this point
Copy the full SHA a5ec82fView commit details -
n-api,test: add a new.target test to addons-napi
Added a N-API test to verify new.target behavior. PR-URL: nodejs#19236 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b0e458a - Browse repository at this point
Copy the full SHA b0e458aView commit details -
n-api: take n-api out of experimental
Take n-api out of experimental as per: nodejs/TSC#501 PR-URL: nodejs#19262 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f07b614 - Browse repository at this point
Copy the full SHA f07b614View commit details -
n-api,test: add int64 bounds tests
Added some simple tests to verify that the int64 API is correctly handling numbers greater than 32-bits. This is a basic test, but verifies that an implementer hasn't truncated back to 32-bits. Refs: nodejs/node-chakracore#496 PR-URL: nodejs#19309 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gabriel Schulhof <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fdd3f57 - Browse repository at this point
Copy the full SHA fdd3f57View commit details -
PR-URL: nodejs#19385 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7c784de - Browse repository at this point
Copy the full SHA 7c784deView commit details -
n-api: add missing exception checking
Add checks for a pending exception in napi_make_callback after the callback has been invoked. If there is a pending exception then we need to avoid checking the result as that will not be able to complete properly. Add additional checks to the unit test for napi_make_callback to catch this case. PR-URL: nodejs#19362 Fixes: nodejs/node-addon-api#235 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dd61f8e - Browse repository at this point
Copy the full SHA dd61f8eView commit details -
n-api: add napi_fatal_exception
Add function to trigger and uncaught exception. Useful if an async callback throws an exception with no way to recover. PR-URL: nodejs#19337 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 78ccedf - Browse repository at this point
Copy the full SHA 78ccedfView commit details -
n-api: re-write test_make_callback
This re-writes the test in C by dropping std::vector<napi_value> in favour of a C99 variable length array, and by dropping the anonymous namespace in favour of static function declarations. PR-URL: nodejs#19448 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for 6b12016 - Browse repository at this point
Copy the full SHA 6b12016View commit details -
PR-URL: nodejs#19555 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 041c9a0 - Browse repository at this point
Copy the full SHA 041c9a0View commit details -
n-api: bump version of n-api supported
Bump the version due to additions to the api. PR-URL: nodejs#19497 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 96fe46b - Browse repository at this point
Copy the full SHA 96fe46bView commit details -
n-api: ensure in-module exceptions are propagated
Whenever we call into an addon, whether it is for a callback, for module init, or for async work-related reasons, we should make sure that * the last error is cleared, * the scopes before the call are the same as after, and * if an exception was thrown and captured inside the module, then it is re-thrown after the call. Therefore we should call into the module in a unified fashion. This change introduces the macro NAPI_CALL_INTO_MODULE() which should be used whenever invoking a callback provided by the module. Fixes: nodejs#19437 PR-URL: nodejs#19537 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for f4b0f7a - Browse repository at this point
Copy the full SHA f4b0f7aView commit details -
n-api: back up env before finalize
Heed the comment to not use fields of a Reference after calling its finalize callback, because such a call may destroy the Reference. Fixes: nodejs#19673 PR-URL: nodejs#19718 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Gabriel Schulhof committedApr 16, 2018 Configuration menu - View commit details
-
Copy full SHA for dc4c825 - Browse repository at this point
Copy the full SHA dc4c825View commit details -
* Updated tests for `Number` and `int32_t` * Added new tests for `int64_t` * Updated N-API `int64_t` behavior to return zero for all non-finite numbers * Clarified the documentation for these calls. PR-URL: nodejs#19402 Refs: nodejs/node-chakracore#500 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f498a62 - Browse repository at this point
Copy the full SHA f498a62View commit details