@@ -149,31 +149,22 @@ void InspectorConsoleCall(const FunctionCallbackInfo<Value>& info) {
149149 Environment* env = Environment::GetCurrent (info);
150150 Isolate* isolate = env->isolate ();
151151 Local<Context> context = isolate->GetCurrentContext ();
152- CHECK_LT ( 2 , info.Length ());
153- SlicedArguments call_args (info, /* start */ 3 );
152+ CHECK_GE ( info.Length (), 2 );
153+ SlicedArguments call_args (info, /* start */ 2 );
154154 if (InspectorEnabled (env)) {
155155 Local<Value> inspector_method = info[0 ];
156156 CHECK (inspector_method->IsFunction ());
157- Local<Value> config_value = info[2 ];
158- CHECK (config_value->IsObject ());
159- Local<Object> config_object = config_value.As <Object>();
160- Local<String> in_call_key = FIXED_ONE_BYTE_STRING (isolate, " in_call" );
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 () ||
157+ if (!env->is_in_inspector_console_call ()) {
158+ env->set_is_in_inspector_console_call (true );
159+ MaybeLocal<Value> ret =
168160 inspector_method.As <Function>()->Call (context,
169161 info.Holder (),
170162 call_args.length (),
171- call_args.out ()).IsEmpty ()) {
163+ call_args.out ());
164+ env->set_is_in_inspector_console_call (false );
165+ if (ret.IsEmpty ())
172166 return ;
173- }
174167 }
175- if (config_object->Delete (context, in_call_key).IsNothing ())
176- return ;
177168 }
178169
179170 Local<Value> node_method = info[1 ];
0 commit comments