Browse Source

async_wrap: make uid the first argument in init

All other hooks have uid as the first argument, this makes it consistent
for all hooks.

PR-URL: https://github.com/nodejs/node/pull/4600
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
v5.x
Andreas Madsen 9 years ago
committed by Rod Vagg
parent
commit
4ef04c7c4c
  1. 2
      src/async-wrap-inl.h
  2. 4
      test/parallel/test-async-wrap-check-providers.js
  3. 2
      test/parallel/test-async-wrap-disabled-propagate-parent.js
  4. 2
      test/parallel/test-async-wrap-propagate-parent.js
  5. 2
      test/parallel/test-async-wrap-uid.js

2
src/async-wrap-inl.h

@ -40,8 +40,8 @@ inline AsyncWrap::AsyncWrap(Environment* env,
v8::HandleScope scope(env->isolate()); v8::HandleScope scope(env->isolate());
v8::Local<v8::Value> argv[] = { v8::Local<v8::Value> argv[] = {
v8::Int32::New(env->isolate(), provider),
v8::Integer::New(env->isolate(), get_uid()), v8::Integer::New(env->isolate(), get_uid()),
v8::Int32::New(env->isolate(), provider),
Null(env->isolate()) Null(env->isolate())
}; };

4
test/parallel/test-async-wrap-check-providers.js

@ -29,8 +29,8 @@ if (common.isAix) {
} }
} }
function init(id) { function init(id, provider) {
keyList = keyList.filter((e) => e != pkeys[id]); keyList = keyList.filter((e) => e != pkeys[provider]);
} }
function noop() { } function noop() { }

2
test/parallel/test-async-wrap-disabled-propagate-parent.js

@ -10,7 +10,7 @@ let cntr = 0;
let server; let server;
let client; let client;
function init(type, id, parent) { function init(id, type, parent) {
if (parent) { if (parent) {
cntr++; cntr++;
// Cannot assert in init callback or will abort. // Cannot assert in init callback or will abort.

2
test/parallel/test-async-wrap-propagate-parent.js

@ -9,7 +9,7 @@ let cntr = 0;
let server; let server;
let client; let client;
function init(type, id, parent) { function init(id, type, parent) {
if (parent) { if (parent) {
cntr++; cntr++;
// Cannot assert in init callback or will abort. // Cannot assert in init callback or will abort.

2
test/parallel/test-async-wrap-uid.js

@ -9,7 +9,7 @@ const storage = new Map();
async_wrap.setupHooks(init, pre, post, destroy); async_wrap.setupHooks(init, pre, post, destroy);
async_wrap.enable(); async_wrap.enable();
function init(provider, uid) { function init(uid) {
storage.set(uid, { storage.set(uid, {
init: true, init: true,
pre: false, pre: false,

Loading…
Cancel
Save