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 concistent
for all hooks.

Ref: #7048
PR-URL: #4600
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
  • Loading branch information
AndreasMadsen authored and Myles Borins committed Jul 12, 2016
1 parent 13d465b commit e10eebf
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 @@ -9,7 +9,7 @@ const providers = Object.keys(async_wrap.Providers);
let cntr = 0;
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 @@ -8,7 +8,7 @@ const async_wrap = process.binding('async_wrap');
let cntr = 0;
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 e10eebf

Please sign in to comment.