inspector: forward errors from InspectorConsoleCall
Do not assume that entering JS cannot fail. PR-URL: https://github.com/nodejs/node/pull/26113 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
0896fbedf8
commit
009efd0ec3
@ -158,16 +158,22 @@ void InspectorConsoleCall(const FunctionCallbackInfo<Value>& info) {
|
|||||||
CHECK(config_value->IsObject());
|
CHECK(config_value->IsObject());
|
||||||
Local<Object> config_object = config_value.As<Object>();
|
Local<Object> config_object = config_value.As<Object>();
|
||||||
Local<String> in_call_key = FIXED_ONE_BYTE_STRING(isolate, "in_call");
|
Local<String> in_call_key = FIXED_ONE_BYTE_STRING(isolate, "in_call");
|
||||||
if (!config_object->Has(context, in_call_key).FromMaybe(false)) {
|
bool has_in_call;
|
||||||
CHECK(config_object->Set(context,
|
if (!config_object->Has(context, in_call_key).To(&has_in_call))
|
||||||
|
return;
|
||||||
|
if (!has_in_call) {
|
||||||
|
if (config_object->Set(context,
|
||||||
in_call_key,
|
in_call_key,
|
||||||
v8::True(isolate)).FromJust());
|
v8::True(isolate)).IsNothing() ||
|
||||||
CHECK(!inspector_method.As<Function>()->Call(context,
|
inspector_method.As<Function>()->Call(context,
|
||||||
info.Holder(),
|
info.Holder(),
|
||||||
call_args.length(),
|
call_args.length(),
|
||||||
call_args.out()).IsEmpty());
|
call_args.out()).IsEmpty()) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
CHECK(config_object->Delete(context, in_call_key).FromJust());
|
}
|
||||||
|
if (config_object->Delete(context, in_call_key).IsNothing())
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Value> node_method = info[1];
|
Local<Value> node_method = info[1];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user