From 4ef04c7c4c4d56235d7ac028b6b4d65fa0a9a4c6 Mon Sep 17 00:00:00 2001 From: Andreas Madsen Date: Sat, 9 Jan 2016 12:27:53 +0100 Subject: [PATCH] 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 Reviewed-By: Sakthipriyan Vairamani --- src/async-wrap-inl.h | 2 +- test/parallel/test-async-wrap-check-providers.js | 4 ++-- test/parallel/test-async-wrap-disabled-propagate-parent.js | 2 +- test/parallel/test-async-wrap-propagate-parent.js | 2 +- test/parallel/test-async-wrap-uid.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/async-wrap-inl.h b/src/async-wrap-inl.h index 1d9ebe27e45bef..e68c6af4d6efd1 100644 --- a/src/async-wrap-inl.h +++ b/src/async-wrap-inl.h @@ -40,8 +40,8 @@ inline AsyncWrap::AsyncWrap(Environment* env, v8::HandleScope scope(env->isolate()); v8::Local argv[] = { - v8::Int32::New(env->isolate(), provider), v8::Integer::New(env->isolate(), get_uid()), + v8::Int32::New(env->isolate(), provider), Null(env->isolate()) }; diff --git a/test/parallel/test-async-wrap-check-providers.js b/test/parallel/test-async-wrap-check-providers.js index 907b9fa3159926..c08c7a43d445e0 100644 --- a/test/parallel/test-async-wrap-check-providers.js +++ b/test/parallel/test-async-wrap-check-providers.js @@ -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() { } diff --git a/test/parallel/test-async-wrap-disabled-propagate-parent.js b/test/parallel/test-async-wrap-disabled-propagate-parent.js index 70d82befe72a63..0b987a5495e66c 100644 --- a/test/parallel/test-async-wrap-disabled-propagate-parent.js +++ b/test/parallel/test-async-wrap-disabled-propagate-parent.js @@ -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. diff --git a/test/parallel/test-async-wrap-propagate-parent.js b/test/parallel/test-async-wrap-propagate-parent.js index beeb27ba7866a9..99322b03f7adfd 100644 --- a/test/parallel/test-async-wrap-propagate-parent.js +++ b/test/parallel/test-async-wrap-propagate-parent.js @@ -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. diff --git a/test/parallel/test-async-wrap-uid.js b/test/parallel/test-async-wrap-uid.js index ad2dd5027cfa1d..4e664f1bd46ebb 100644 --- a/test/parallel/test-async-wrap-uid.js +++ b/test/parallel/test-async-wrap-uid.js @@ -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,