From bf566718b29a6fae8cef8d0fecd7e77948726d5a Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 23 Dec 2018 00:02:14 +0800 Subject: src: refactor tickInfo access - Wrap access to tickInfo fields in functions - Rename `kHasScheduled` to `kHasTickScheduled` and `kHasPromiseRejections` to `kHasRejectionToWarn` for clarity - note the latter will be set to false if the rejection does not lead to a warning so the previous description is not accurate. - Set `kHasRejectionToWarn` in JS land of relying on C++ to use an implict contract (return value of the promise rejection handler) to set it, as the decision is made entirely in JS land. - Destructure promise reject event constants. PR-URL: https://github.com/nodejs/node/pull/25200 Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell --- src/node_task_queue.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/node_task_queue.cc') diff --git a/src/node_task_queue.cc b/src/node_task_queue.cc index f65f420081..5bfa281068 100644 --- a/src/node_task_queue.cc +++ b/src/node_task_queue.cc @@ -17,7 +17,6 @@ using v8::kPromiseRejectAfterResolved; using v8::kPromiseRejectWithNoHandler; using v8::kPromiseResolveAfterResolved; using v8::Local; -using v8::MaybeLocal; using v8::Number; using v8::Object; using v8::Promise; @@ -80,13 +79,8 @@ static void PromiseRejectCallback(PromiseRejectMessage message) { } Local args[] = { type, promise, value }; - MaybeLocal ret = callback->Call(env->context(), - Undefined(isolate), - arraysize(args), - args); - - if (!ret.IsEmpty() && ret.ToLocalChecked()->IsTrue()) - env->tick_info()->promise_rejections_toggle_on(); + USE(callback->Call( + env->context(), Undefined(isolate), arraysize(args), args)); } static void InitializePromiseRejectCallback( -- cgit v1.2.3