GeezerVison is showing github.com — src: remove dead code in async_wrap · nodejs/node@4559fac
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: src/async_wrap.cc +2-21Lines changed: 2 additions & 21 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -488,31 +488,15 @@ AsyncWrap::AsyncWrap(Environment* env, | 488 | 488 | Local<Object> object, | 489 | 489 | ProviderType provider, | 490 | 490 | double execution_async_id) | 491 | | - : AsyncWrap(env, object, provider, execution_async_id, false) {} | 492 | | - | 493 | | -AsyncWrap::AsyncWrap(Environment* env, | 494 | | - Local<Object> object, | 495 | | - ProviderType provider, | 496 | | - double execution_async_id, | 497 | | - bool silent) | 498 | 491 | : AsyncWrap(env, object) { | 499 | 492 | CHECK_NE(provider, PROVIDER_NONE); | 500 | 493 | provider_type_ = provider; | 501 | 494 |
| 502 | 495 | // Use AsyncReset() call to execute the init() callbacks. | 503 | | - AsyncReset(object, execution_async_id, silent); | | 496 | + AsyncReset(object, execution_async_id); | 504 | 497 | init_hook_ran_ = true; | 505 | 498 | } | 506 | 499 |
| 507 | | -AsyncWrap::AsyncWrap(Environment* env, | 508 | | - Local<Object> object, | 509 | | - ProviderType provider, | 510 | | - double execution_async_id, | 511 | | - double trigger_async_id) | 512 | | - : AsyncWrap(env, object, provider, execution_async_id, true) { | 513 | | - trigger_async_id_ = trigger_async_id; | 514 | | -} | 515 | | - | 516 | 500 | AsyncWrap::AsyncWrap(Environment* env, Local<Object> object) | 517 | 501 | : BaseObject(env, object), | 518 | 502 | context_frame_(env->isolate(), | @@ -592,8 +576,7 @@ void AsyncWrap::EmitDestroy(Environment* env, double async_id) { | 592 | 576 | // Generalized call for both the constructor and for handles that are pooled | 593 | 577 | // and reused over their lifetime. This way a new uid can be assigned when | 594 | 578 | // the resource is pulled out of the pool and put back into use. | 595 | | -void AsyncWrap::AsyncReset(Local<Object> resource, double execution_async_id, | 596 | | - bool silent) { | | 579 | +void AsyncWrap::AsyncReset(Local<Object> resource, double execution_async_id) { | 597 | 580 | CHECK_NE(provider_type(), PROVIDER_NONE); | 598 | 581 |
| 599 | 582 | if (async_id_ != kInvalidAsyncId) { | @@ -642,8 +625,6 @@ void AsyncWrap::AsyncReset(Local<Object> resource, double execution_async_id, | 642 | 625 |
| 643 | 626 | context_frame_.Reset(isolate, async_context_frame::current(isolate)); | 644 | 627 |
| 645 | | - if (silent) return; | 646 | | - | 647 | 628 | EmitAsyncInit(env(), resource, | 648 | 629 | env()->async_hooks()->provider_string(provider_type()), | 649 | 630 | async_id_, trigger_async_id_); | |
Collapse file Copy file name to clipboardExpand all lines: src/async_wrap.h +1-14Lines changed: 1 addition & 14 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -190,8 +190,7 @@ class AsyncWrap : public BaseObject { | 190 | 190 | inline v8::Local<v8::Value> context_frame() const; | 191 | 191 |
| 192 | 192 | void AsyncReset(v8::Local<v8::Object> resource, | 193 | | - double execution_async_id = kInvalidAsyncId, | 194 | | - bool silent = false); | | 193 | + double execution_async_id = kInvalidAsyncId); | 195 | 194 |
| 196 | 195 | // Only call these within a valid HandleScope. | 197 | 196 | v8::MaybeLocal<v8::Value> MakeCallback(const v8::Local<v8::Function> cb, | @@ -224,18 +223,6 @@ class AsyncWrap : public BaseObject { | 224 | 223 | bool IsDoneInitializing() const override; | 225 | 224 |
| 226 | 225 | private: | 227 | | - friend class PromiseWrap; | 228 | | - | 229 | | - AsyncWrap(Environment* env, | 230 | | - v8::Local<v8::Object> promise, | 231 | | - ProviderType provider, | 232 | | - double execution_async_id, | 233 | | - bool silent); | 234 | | - AsyncWrap(Environment* env, | 235 | | - v8::Local<v8::Object> promise, | 236 | | - ProviderType provider, | 237 | | - double execution_async_id, | 238 | | - double trigger_async_id); | 239 | 226 | ProviderType provider_type_ = PROVIDER_NONE; | 240 | 227 | bool init_hook_ran_ = false; | 241 | 228 | // Because the values may be Reset(), cannot be made const. | |
|