Skip to content

Commit e10eebf

Browse files
AndreasMadsenMyles Borins
authored and
Myles Borins
committed
async_wrap: make uid the first argument in init
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 <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent 13d465b commit e10eebf

5 files changed

+6
-6
lines changed

src/async-wrap-inl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ inline AsyncWrap::AsyncWrap(Environment* env,
4040
v8::HandleScope scope(env->isolate());
4141

4242
v8::Local<v8::Value> argv[] = {
43-
v8::Int32::New(env->isolate(), provider),
4443
v8::Integer::New(env->isolate(), get_uid()),
44+
v8::Int32::New(env->isolate(), provider),
4545
Null(env->isolate())
4646
};
4747

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ if (common.isAix) {
2929
}
3030
}
3131

32-
function init(id) {
33-
keyList = keyList.filter((e) => e != pkeys[id]);
32+
function init(id, provider) {
33+
keyList = keyList.filter((e) => e != pkeys[provider]);
3434
}
3535

3636
function noop() { }

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const providers = Object.keys(async_wrap.Providers);
99
let cntr = 0;
1010
let client;
1111

12-
function init(type, id, parent) {
12+
function init(id, type, parent) {
1313
if (parent) {
1414
cntr++;
1515
// Cannot assert in init callback or will abort.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const async_wrap = process.binding('async_wrap');
88
let cntr = 0;
99
let client;
1010

11-
function init(type, id, parent) {
11+
function init(id, type, parent) {
1212
if (parent) {
1313
cntr++;
1414
// Cannot assert in init callback or will abort.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const storage = new Map();
99
async_wrap.setupHooks(init, pre, post, destroy);
1010
async_wrap.enable();
1111

12-
function init(provider, uid) {
12+
function init(uid) {
1313
storage.set(uid, {
1414
init: true,
1515
pre: false,

0 commit comments

Comments
 (0)