Skip to content

Commit be671c3

Browse files
addaleaxrvagg
authored andcommitted
inspector: forward errors from InspectorConsoleCall
Do not assume that entering JS cannot fail. PR-URL: #26113 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Eugene Ostroukhov <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 7d66d47 commit be671c3

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/inspector_js_api.cc

+15-9
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,22 @@ void InspectorConsoleCall(const FunctionCallbackInfo<Value>& info) {
158158
CHECK(config_value->IsObject());
159159
Local<Object> config_object = config_value.As<Object>();
160160
Local<String> in_call_key = FIXED_ONE_BYTE_STRING(isolate, "in_call");
161-
if (!config_object->Has(context, in_call_key).FromMaybe(false)) {
162-
CHECK(config_object->Set(context,
163-
in_call_key,
164-
v8::True(isolate)).FromJust());
165-
CHECK(!inspector_method.As<Function>()->Call(context,
166-
info.Holder(),
167-
call_args.length(),
168-
call_args.out()).IsEmpty());
161+
bool has_in_call;
162+
if (!config_object->Has(context, in_call_key).To(&has_in_call))
163+
return;
164+
if (!has_in_call) {
165+
if (config_object->Set(context,
166+
in_call_key,
167+
v8::True(isolate)).IsNothing() ||
168+
inspector_method.As<Function>()->Call(context,
169+
info.Holder(),
170+
call_args.length(),
171+
call_args.out()).IsEmpty()) {
172+
return;
173+
}
169174
}
170-
CHECK(config_object->Delete(context, in_call_key).FromJust());
175+
if (config_object->Delete(context, in_call_key).IsNothing())
176+
return;
171177
}
172178

173179
Local<Value> node_method = info[1];

0 commit comments

Comments
 (0)