diff options
author | Trevor Norris <trev.norris@gmail.com> | 2016-02-22 16:34:35 -0700 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2016-03-28 11:32:37 -0600 |
commit | f9938b61418a448a8ef835c1016233e41ed5948e (patch) | |
tree | 33a00ba26059994a56ecc12297a9cde11324428b /test | |
parent | 2dadd8901a85a3e100e8a907b1b64c45dd59eb5a (diff) | |
download | android-node-v8-f9938b61418a448a8ef835c1016233e41ed5948e.tar.gz android-node-v8-f9938b61418a448a8ef835c1016233e41ed5948e.tar.bz2 android-node-v8-f9938b61418a448a8ef835c1016233e41ed5948e.zip |
async_wrap: setupHooks now accepts object
The number of callbacks accepted to setupHooks was getting unwieldy.
Instead change the implementation to accept an object with all callbacks
PR-URL: https://github.com/nodejs/node/pull/5756
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Diffstat (limited to 'test')
5 files changed, 6 insertions, 6 deletions
diff --git a/test/parallel/test-async-wrap-check-providers.js b/test/parallel/test-async-wrap-check-providers.js index cd95e7a0f9..4b5447b82c 100644 --- a/test/parallel/test-async-wrap-check-providers.js +++ b/test/parallel/test-async-wrap-check-providers.js @@ -36,7 +36,7 @@ function init(id, provider) { function noop() { } -async_wrap.setupHooks(init, noop, noop); +async_wrap.setupHooks({ init }); async_wrap.enable(); diff --git a/test/parallel/test-async-wrap-disabled-propagate-parent.js b/test/parallel/test-async-wrap-disabled-propagate-parent.js index ee674c43ff..5d5b2b2737 100644 --- a/test/parallel/test-async-wrap-disabled-propagate-parent.js +++ b/test/parallel/test-async-wrap-disabled-propagate-parent.js @@ -31,7 +31,7 @@ function init(uid, type, parentUid, parentHandle) { function noop() { } -async_wrap.setupHooks(init, noop, noop); +async_wrap.setupHooks({ init }); async_wrap.enable(); server = net.createServer(function(c) { diff --git a/test/parallel/test-async-wrap-propagate-parent.js b/test/parallel/test-async-wrap-propagate-parent.js index c27803832d..ad3fdff016 100644 --- a/test/parallel/test-async-wrap-propagate-parent.js +++ b/test/parallel/test-async-wrap-propagate-parent.js @@ -31,7 +31,7 @@ function init(uid, type, parentUid, parentHandle) { function noop() { } -async_wrap.setupHooks(init, noop, noop); +async_wrap.setupHooks({ init }); async_wrap.enable(); server = net.createServer(function(c) { diff --git a/test/parallel/test-async-wrap-throw-no-init.js b/test/parallel/test-async-wrap-throw-no-init.js index 768e38e8ef..ccf77f66dc 100644 --- a/test/parallel/test-async-wrap-throw-no-init.js +++ b/test/parallel/test-async-wrap-throw-no-init.js @@ -7,14 +7,14 @@ const async_wrap = process.binding('async_wrap'); assert.throws(function() { async_wrap.setupHooks(null); -}, /init callback must be a function/); +}, /first argument must be an object/); assert.throws(function() { async_wrap.enable(); }, /init callback is not assigned to a function/); // Should not throw -async_wrap.setupHooks(() => {}); +async_wrap.setupHooks({ init: () => {} }); async_wrap.enable(); assert.throws(function() { diff --git a/test/parallel/test-async-wrap-uid.js b/test/parallel/test-async-wrap-uid.js index 4e664f1bd4..5bf3a8856e 100644 --- a/test/parallel/test-async-wrap-uid.js +++ b/test/parallel/test-async-wrap-uid.js @@ -6,7 +6,7 @@ const assert = require('assert'); const async_wrap = process.binding('async_wrap'); const storage = new Map(); -async_wrap.setupHooks(init, pre, post, destroy); +async_wrap.setupHooks({ init, pre, post, destroy }); async_wrap.enable(); function init(uid) { |