Skip to content

Commit

Permalink
async_wrap: make uid the first argument in init
Browse files Browse the repository at this point in the history
All other hooks have uid as the first argument, this makes it consistent
for all hooks.

PR-URL: #4600
Reviewed-By: Trevor Norris <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
  • Loading branch information
AndreasMadsen authored and rvagg committed Feb 21, 2016
1 parent 4afe801 commit 4ef04c7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/async-wrap-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ inline AsyncWrap::AsyncWrap(Environment* env,
v8::HandleScope scope(env->isolate());

v8::Local<v8::Value> argv[] = {
v8::Int32::New(env->isolate(), provider),
v8::Integer::New(env->isolate(), get_uid()),
v8::Int32::New(env->isolate(), provider),
Null(env->isolate())
};

Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-async-wrap-check-providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ if (common.isAix) {
}
}

function init(id) {
keyList = keyList.filter((e) => e != pkeys[id]);
function init(id, provider) {
keyList = keyList.filter((e) => e != pkeys[provider]);
}

function noop() { }
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-async-wrap-disabled-propagate-parent.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let cntr = 0;
let server;
let client;

function init(type, id, parent) {
function init(id, type, parent) {
if (parent) {
cntr++;
// Cannot assert in init callback or will abort.
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-async-wrap-propagate-parent.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let cntr = 0;
let server;
let client;

function init(type, id, parent) {
function init(id, type, parent) {
if (parent) {
cntr++;
// Cannot assert in init callback or will abort.
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-async-wrap-uid.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const storage = new Map();
async_wrap.setupHooks(init, pre, post, destroy);
async_wrap.enable();

function init(provider, uid) {
function init(uid) {
storage.set(uid, {
init: true,
pre: false,
Expand Down

0 comments on commit 4ef04c7

Please sign in to comment.