From a3c5ccd78ce2dbf6104f6145afd430654f125961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Fri, 30 Jun 2017 11:28:17 +0200 Subject: [PATCH] src: fix new V8 compiler warnings PR-URL: https://github.com/nodejs/node/pull/14004 Reviewed-By: Anna Henningsen Reviewed-By: Anna Henningsen Reviewed-By: Franziska Hinkelmann Reviewed-By: James M Snell Reviewed-By: Matteo Collina Reviewed-By: Colin Ihrig --- src/inspector_agent.cc | 11 ++++++----- src/node_url.cc | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index 6599e87043..4d51c3d140 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -219,7 +219,8 @@ class JsBindingsSessionDelegate : public InspectorSessionDelegate { Local argument = v8string.ToLocalChecked().As(); Local callback = callback_.Get(isolate); Local receiver = receiver_.Get(isolate); - static_cast(callback->Call(env_->context(), receiver, 1, &argument)); + callback->Call(env_->context(), receiver, 1, &argument) + .FromMaybe(Local()); } void Disconnect() { @@ -353,10 +354,10 @@ void InspectorConsoleCall(const v8::FunctionCallbackInfo& info) { Local node_method = info[1]; CHECK(node_method->IsFunction()); - static_cast(node_method.As()->Call(context, - info.Holder(), - call_args.size(), - call_args.data())); + node_method.As()->Call(context, + info.Holder(), + call_args.size(), + call_args.data()).FromMaybe(Local()); } void CallAndPauseOnStart( diff --git a/src/node_url.cc b/src/node_url.cc index c50700b294..54dbc3a053 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -1943,7 +1943,7 @@ static void Parse(Environment* env, null, // fragment defaults to null }; SetArgs(env, argv, &url); - (void)cb->Call(context, recv, arraysize(argv), argv); + cb->Call(context, recv, arraysize(argv), argv).FromMaybe(Local()); } else if (error_cb->IsFunction()) { Local argv[2] = { undef, undef }; argv[ERR_ARG_FLAGS] = Integer::NewFromUnsigned(isolate, url.flags); @@ -1951,7 +1951,8 @@ static void Parse(Environment* env, String::NewFromUtf8(env->isolate(), input, v8::NewStringType::kNormal).ToLocalChecked(); - (void)error_cb.As()->Call(context, recv, arraysize(argv), argv); + error_cb.As()->Call(context, recv, arraysize(argv), argv) + .FromMaybe(Local()); } }