summaryrefslogtreecommitdiff
path: root/test/addons
AgeCommit message (Collapse)Author
2017-12-01src: use nullptr instead of NULLDaniel Bevenius
PR-URL: https://github.com/nodejs/node/pull/17373 Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-11-21src: add helper for addons to get the event loopAnna Henningsen
Add a utility functions for addons to use when they need a reference to the current event loop. Currently, `uv_default_loop()` works if the embedder is the single-threaded default node executable, but even without the presence of e.g. workers that might not really an API guarantee for when Node is embedded. PR-URL: https://github.com/nodejs/node/pull/17109 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-16test: --enable-static linked executableDaniel Bevenius
The motivation for this commit is to enable projects embedding Node.js and building with --enable-static to be able to run the test suite and linter. Currently when building with --enable-static no node executable will be created which means that the tests (apart from the cctest) and linter cannot be run. This is currently a work in progress and works on MacOS but I need to run the CI, and manually on different environments to verify that it works as expected. PR-URL: https://github.com/nodejs/node/pull/14986 Refs: https://github.com/nodejs/node/issues/14158 Refs: https://github.com/nodejs/node/pull/14892 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-11-11tls: implement clientCertEngine optionjoelostrowski
Add an option 'clientCertEngine' to `tls.createSecureContext()` which gets wired up to OpenSSL function `SSL_CTX_set_client_cert_engine`. The option is passed through from `https.request()` as well. This allows using a custom OpenSSL engine to provide the client certificate.
2017-11-07test: remove custom message from assertionNicolas Morel
The custom message means that the values involved are not reported. Remove the custom message for a more detailed error message. PR-URL: https://github.com/nodejs/node/pull/16824 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-10-27test: use common.buildType in repl-domain-abortRich Trott
use `common.buildType` instead of `process.config.target_defaults.default_configuration` in repl-domain-abort addon test. PR-URL: https://github.com/nodejs/node/pull/16538 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-15n-api: use module name macroMichael Dawson
Update tests to use module name macro PR-URL: https://github.com/nodejs/node/pull/16185 Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-14test: remove error messages for readabilityFadi Asfour
PR-URL: https://github.com/nodejs/node/pull/16022 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-10-13test: fix test-esm-addonsRich Trott
Move test-esm-addons to test/addons/hello-world-esm. Test should now work properly on CI machines where `addons` are not always built at the expected relative path from the es-modules tests. Test should now work in Debug builds. PR-URL: https://github.com/nodejs/node/pull/16174 Fixes: https://github.com/nodejs/node/issues/16155 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-10-11test: clean up string concat in dlopen-ping-pongagilbert
replace string concatenation with template literals. PR-URL: https://github.com/nodejs/node/pull/15820 Reviewed-By: Ryan Graham <r.m.graham@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-10-02test: check that this != new.target in addonBen Noordhuis
Add two checks that are there for expository reasons as much as they are sanity checks. PR-URL: https://github.com/nodejs/node/pull/15681 Refs: https://github.com/nodejs/node-addon-api/issues/142 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-09-27test: skip test when checking async_hooksTrevor Norris
The test addons/async-hooks-promise depends on there being only one hook available. So skip it if NODE_TEST_WITH_ASYNC_HOOKS is set. PR-URL: https://github.com/nodejs/node/pull/14208 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-09-20build: enable runtime linkingjBarz
Enable runtime linking of shared objects. This will allow loading of symbols using the RTLD_GLOBAL flag. PR-URL: https://github.com/nodejs/node/pull/15286 Fixes: https://github.com/nodejs/node/issues/15243 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-14test: add regression test for 5691Anna Henningsen
With `CallbackScope`, this has become possible to do properly. Fixes: https://github.com/nodejs/node/issues/5691 PR-URL: https://github.com/nodejs/node/pull/14697 Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-14src: refactor async callback handlingAnna Henningsen
- Merge the two almost-but-not-quite identical `MakeCallback()` implementations - Provide a public `CallbackScope` class for embedders in order to enable `MakeCallback()`-like behaviour without tying that to calling a JS function PR-URL: https://github.com/nodejs/node/pull/14697 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-10test,doc: make module name match gyp target nameGabriel Schulhof
Currently the nm_modname does not match the file name of the resulting module. In fact, the nm_modname is pretty arbitrary. This seeks to introduce some consistency into the nm_modname property by having the name of the module appear in exactly one place: the "target_name" property of the gyp target that builds the module. PR-URL: https://github.com/nodejs/node/pull/15209 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-09-08src: add support to pass flags to dlopenEzequiel Garcia
* add constants for dlopen flags, which are needed for dlopen's flag passing. * introduce an optional parameter for process.dlopen(), allowing to pass dlopen flags (using values from os.constants.dlopen). If no flags are passed, the default behavior is to load the library with RTLD_LAZY (perform lazy binding) and RTLD_LOCAL (symbols are available only locally). PR-URL: https://github.com/nodejs/node/pull/12794 Refs: https://github.com/nodejs/node/pull/4105 Refs: https://github.com/libuv/libuv/pull/1331 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-08-24test: extend async addon testAnna Henningsen
Test more current behaviour, based on discussions in https://github.com/nodejs/node/pull/14697. PR-URL: https://github.com/nodejs/node/pull/14922 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-23test: remove unused parametersDaniil Shakir
PR-URL: https://github.com/nodejs/node/pull/14968 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Cai <davidcai1993@yahoo.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-14test: add test to verify ErrnoException pathDaniel Bevenius
This commit adds a test to verify that the path argument to ErrnoException can contain UTF-8 characters. PR-URL: https://github.com/nodejs/node/pull/13958 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-04test: support odd value for kStringMaxLengthMichaël Zasso
V8 6.2 will support a larger maximum string length on 64-bit platforms. Update the test to take into account its odd value ((1 << 30) - 1 - 24). Refs: https://github.com/v8/v8/commit/e8c9649e2570c7e278e70a6584738a3c3f828b2b PR-URL: https://github.com/nodejs/node/pull/14476 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
2017-08-01test: add check on an addon that does not registerEzequiel Garcia
This commit calls require on a shared library that is not declared as a node module, and therefore does not register properly. PR-URL: https://github.com/nodejs/node/pull/13954 Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-07-21lib,src: fix consistent spacing inside bracesSebastiaan Deckers
PR-URL: https://github.com/nodejs/node/pull/14162 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-06async_hooks: C++ Embedder API overhaulAndreas Madsen
* Fix AsyncHooksGetTriggerAsyncId such it corresponds to async_hooks.triggerAsyncId and not async_hooks.initTriggerId. * Use an async_context struct instead of two async_uid values. This change was necessary since the fixing AsyncHooksGetTriggerAsyncId otherwise makes it impossible to get the correct default trigger id. It also prevents an invalid triggerAsyncId in MakeCallback. * Rename async_uid to async_id for consistency * Rename get_uid to get_async_id * Add get_trigger_async_id to AsyncResource class PR-URL: https://github.com/nodejs/node/pull/14040 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-07-04test: simplify test skippingVse Mozhet Byt
* Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-07-02test: replace indexOf with includes and startsWithNataly Shrits
PR-URL: https://github.com/nodejs/node/pull/13852 Refs: https://github.com/nodejs/node/issues/12586 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2017-07-02test: remove undef NDEBUG from at-exit addons testDaniel Bevenius
The at-exit addons test uses asserts like the other addons tests, but at-exit is the only one that undefines NDEBUG to make sure that asserts are enabled. This commit removes the undef for consistency. PR-URL: https://github.com/nodejs/node/pull/13998 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-06-28test: remove unneeded HandleScope usageEzequiel Garcia
These methods are Javascript-accessible so they get an implicit HandleScope. The extra scope is unneeded and can be dropped. PR-URL: https://github.com/nodejs/node/pull/13859 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
2017-06-16async_hooks: proper id stacking for PromisesAnna Henningsen
Until now, the async_hooks PromiseHook did not register the Promise’s async id and trigger id on the id stack, so inside the `.then()` handler those ids would be invalid. To fix this, add push and pop calls to its `before` and `after` parts, respectively. Some care needs to be taken for the cases that the Promise hook is being disabled or enabled during the execution of a Promise handler; in the former case, actually removing the hook is delayed by adding another task to the microtask queue, in the latter case popping the id off the async id stack is skipped if the ids don’t match. Fixes: https://github.com/nodejs/node/issues/13583 PR-URL: https://github.com/nodejs/node/pull/13585 Reviewed-By: Trevor Norris <trevnorris@gmail.com>
2017-06-14async_hooks: rename currentId and triggerIdAndreas Madsen
currentId is renamed to executionAsyncId triggerId is renamed to triggerAsyncId AsyncResource.triggerId is renamed to AsyncResource.triggerAsyncId AsyncHooksGetCurrentId is renamed to AsyncHooksGetExecutionAsyncId AsyncHooksGetTriggerId is renamed to AsyncHooksGetTriggerAsyncId PR-URL: https://github.com/nodejs/node/pull/13490 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2017-06-10async_wrap: use kTotals to enable PromiseHookTrevor Norris
Keep a total of enabled hook callbacks in kTotals. This value is used to track whether node::PromiseHook (src/async-wrap.cc) should be enabled or disabled. Don't enable node::PromiseHook, using enablePromiseHook(), until a hook has been added. Then, using disablePromiseHook(), disable node::PromiseHook when all hooks have been disabled. Need to use a native test in order to check the internal field of the Promise and check for a PromiseWrap. PR-URL: https://github.com/nodejs/node/pull/13509 Reviewed-By: Andreas Madsen <amwebdk@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-05-27test: add AsyncResource addon testAnna Henningsen
PR-URL: https://github.com/nodejs/node/pull/13142 Reviewed-By: Matthew Loring <mattloring@google.com> Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
2017-05-15addons: remove semicolons from after module definitionGabriel Schulhof
Having semicolons there runs counter to our documentation and illicits warnings in pedantic mode. This removes semicolons from after uses of NODE_MODULE and NODE_MODULE_CONTEXT_AWARE_BUILTIN. PR-URL: https://github.com/nodejs/node/pull/12919 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
2017-05-14test: add not-called check to heap-profiler testRich Trott
Add `common.mustNotCall()` to make sure there aren't any strange shenanians in the C++ test that would cause the function to execute when it shouldn't. PR-URL: https://github.com/nodejs/node/pull/12985 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-05-05test: reduce string concatenationsVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/12735 Refs: https://github.com/nodejs/node/pull/12455 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-05-01test,lib,doc: use function declarationsRich Trott
Replace function expressions with function declarations in preparation for a lint rule requiring function declarations. PR-URL: https://github.com/nodejs/node/pull/12711 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-04-07test: add a second argument to assert.throws()dave-k
- a regular expression that matches the entire error message. PR-URL: https://github.com/nodejs/node/pull/12139 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
2017-03-29tools: add unescaped regexp dot rule to linterBrian White
PR-URL: https://github.com/nodejs/node/pull/11834 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2017-03-26test: add common.noop, default for common.mustCall()James M Snell
Export a new common.noop no-operation function for general use. Allow using common.mustCall() without a fn argument to simplify test cases. Replace various non-op functions throughout tests with common.noop PR-URL: https://github.com/nodejs/node/pull/12027 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2017-03-10meta: restore original copyright headerJames M Snell
A prior io.js era commit inappropriately removed the original copyright statements from the source. This restores those in any files still remaining from that edit. Ref: https://github.com/nodejs/TSC/issues/174 Ref: https://github.com/nodejs/node/pull/10599 PR-URL: https://github.com/nodejs/node/pull/10155 Note: This PR was required, reviewed-by and approved by the Node.js Foundation Legal Committee and the TSC. There is no `Approved-By:` meta data.
2017-03-04test: make tests pass when configured without-sslDaniel Bevenius
Currently when node is build --without-ssl and the test are run, there are a number of failing test due to tests expecting crypto support to be available. This commit fixes fixes the failure and instead skips the tests that expect crypto to be available. PR-URL: https://github.com/nodejs/node/pull/11631 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-01-11test: use eslint to fix var->const/letGibson Fahnestock
Manually fix issues that eslint --fix couldn't do automatically. PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
2017-01-09test: improve module version mismatch error checkcjihrig
Refs: https://github.com/nodejs/node/pull/10606 PR-URL: https://github.com/nodejs/node/pull/10636 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-01-06test: s/assert.notEqual()/assert.notStrictEqual()/cjihrig
PR-URL: https://github.com/nodejs/node/pull/10541 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com>
2017-01-02test: use const for all require() callscjihrig
PR-URL: https://github.com/nodejs/node/pull/10550 Reviewed-By: Rich Trott <rtrott@gmail.com>
2016-12-01test: replace assert.equal with assert.strictEqualbrad-decker
Using NodeTodo I learned of a need to swap out the .equal function with .strictEqual in a few test files. https://twitter.com/NodeTodo/status/803657321993961472 https://gist.github.com/Trott/864401455d4afa2428cd4814e072bd7c additional commits squashed: .strictEqual's argument signature is actual, expected, [message]. Previously some statements were listed as expected, actual. As asked in PR i swapped them to match the correct argument signature. PR-URL: https://github.com/nodejs/node/pull/9842 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2016-11-21test: add new.target add-on regression testBen Noordhuis
Add a test that checks that new.target inheritance works when inheriting from a constructor defined in C++. PR-URL: https://github.com/nodejs/node/pull/9689 Refs: https://github.com/nodejs/node/issues/9288 Refs: https://github.com/nodejs/node/pull/9293 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-11-09test: refactor make-callback-recurse testRich Trott
Move copy/pasted callback into its own function. PR-URL: https://github.com/nodejs/node/pull/9498 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2016-10-25src: make cross-context MakeCallback() calls workBen Noordhuis
Check that invoking a callback on a receiver from a different context works. It ran afoul of an `env->context() == isolate->GetCurrentContext()` assertion so retrieve the environment from the callback context and the context to enter from the environment's context() method. We could also have retrieved the environment from the receiver's context and that would have made little practical difference. It just seemed more correct to get it from the callback context because that is the actual execution context. PR-URL: https://github.com/nodejs/node/pull/9221 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-10-19test: rename target to exports for consistencyDaniel Bevenius
The doc/api/addons.md document contains examples of Addon Initialization functions that take a parameter named exports. This also matches the name used in node.cc when calling: mp->nm_register_func(exports, module, mp->nm_priv); Currently, a number of the tests name this same parameter target. This commit renames target to exports for consistency. PR-URL: https://github.com/nodejs/node/pull/9135 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>