@@ -262,23 +262,6 @@ static struct {
262
262
platform_->CancelPendingDelayedTasks (isolate);
263
263
}
264
264
265
- #if HAVE_INSPECTOR
266
- bool StartInspector (Environment* env, const char * script_path) {
267
- // Inspector agent can't fail to start, but if it was configured to listen
268
- // right away on the websocket port and fails to bind/etc, this will return
269
- // false.
270
- return env->inspector_agent ()->Start (
271
- script_path == nullptr ? " " : script_path,
272
- env->options ()->debug_options (),
273
- env->inspector_host_port (),
274
- true );
275
- }
276
-
277
- bool InspectorStarted (Environment* env) {
278
- return env->inspector_agent ()->IsListening ();
279
- }
280
- #endif // HAVE_INSPECTOR
281
-
282
265
void StartTracingAgent () {
283
266
if (per_process::cli_options->trace_event_categories .empty ()) {
284
267
tracing_file_writer_ = tracing_agent_->DefaultHandle ();
@@ -317,10 +300,6 @@ static struct {
317
300
void Dispose () {}
318
301
void DrainVMTasks (Isolate* isolate) {}
319
302
void CancelVMTasks (Isolate* isolate) {}
320
- bool StartInspector (Environment* env, const char * script_path) {
321
- env->ThrowError (" Node compiled with NODE_USE_V8_PLATFORM=0" );
322
- return true ;
323
- }
324
303
325
304
void StartTracingAgent () {
326
305
if (!trace_enabled_categories.empty ()) {
@@ -338,12 +317,6 @@ static struct {
338
317
return nullptr ;
339
318
}
340
319
#endif // !NODE_USE_V8_PLATFORM
341
-
342
- #if !NODE_USE_V8_PLATFORM || !HAVE_INSPECTOR
343
- bool InspectorStarted (Environment* env) {
344
- return false ;
345
- }
346
- #endif // !NODE_USE_V8_PLATFORM || !HAVE_INSPECTOR
347
320
} v8_platform;
348
321
349
322
tracing::AgentWriterHandle* GetTracingAgentWriter () {
@@ -774,13 +747,6 @@ void StartExecution(Environment* env, const char* main_script_id) {
774
747
env->context (), Undefined (env->isolate ()), arraysize (argv), argv));
775
748
}
776
749
777
- static void StartInspector (Environment* env, const char * path) {
778
- #if HAVE_INSPECTOR
779
- CHECK (!env->inspector_agent ()->IsListening ());
780
- v8_platform.StartInspector (env, path);
781
- #endif // HAVE_INSPECTOR
782
- }
783
-
784
750
785
751
#ifdef __POSIX__
786
752
void RegisterSignalHandler (int signal,
@@ -1280,13 +1246,24 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data,
1280
1246
Environment env (isolate_data, context);
1281
1247
env.Start (args, exec_args, per_process::v8_is_profiling);
1282
1248
1283
- const char * path = args.size () > 1 ? args[1 ].c_str () : nullptr ;
1284
- StartInspector (&env, path);
1285
-
1249
+ #if HAVE_INSPECTOR && NODE_USE_V8_PLATFORM
1250
+ CHECK (!env.inspector_agent ()->IsListening ());
1251
+ // Inspector agent can't fail to start, but if it was configured to listen
1252
+ // right away on the websocket port and fails to bind/etc, this will return
1253
+ // false.
1254
+ env.inspector_agent ()->Start (args.size () > 1 ? args[1 ].c_str () : " " ,
1255
+ env.options ()->debug_options (),
1256
+ env.inspector_host_port (),
1257
+ true );
1286
1258
if (env.options ()->debug_options ().inspector_enabled &&
1287
- !v8_platform. InspectorStarted (&env )) {
1259
+ !env. inspector_agent ()-> IsListening ( )) {
1288
1260
return 12 ; // Signal internal error.
1289
1261
}
1262
+ #else
1263
+ // inspector_enabled can't be true if !HAVE_INSPECTOR or !NODE_USE_V8_PLATFORM
1264
+ // - the option parser should not allow that.
1265
+ CHECK (!env.options ()->debug_options ().inspector_enabled );
1266
+ #endif // HAVE_INSPECTOR && NODE_USE_V8_PLATFORM
1290
1267
1291
1268
{
1292
1269
Environment::AsyncCallbackScope callback_scope (&env);
0 commit comments