src: move default assignment of async_id_ in async_wrap.h

Moving the default assignment of async_id from the constructor in
async_wrap.cc to class definition in async_wrap.h

PR-URL: https://github.com/nodejs/node/pull/23495
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
David Corona 2018-10-12 09:55:13 -07:00 committed by Anna Henningsen
parent fd230c131d
commit 8ce99faa50
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9
2 changed files with 1 additions and 2 deletions

View File

@ -563,7 +563,6 @@ AsyncWrap::AsyncWrap(Environment* env,
CHECK_NE(provider, PROVIDER_NONE);
CHECK_GE(object->InternalFieldCount(), 1);
async_id_ = -1;
// Use AsyncReset() call to execute the init() callbacks.
AsyncReset(execution_async_id, silent);
}

View File

@ -200,7 +200,7 @@ class AsyncWrap : public BaseObject {
inline AsyncWrap();
const ProviderType provider_type_;
// Because the values may be Reset(), cannot be made const.
double async_id_;
double async_id_ = -1;
double trigger_async_id_;
};