@@ -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 () {
@@ -783,13 +756,6 @@ void StartExecution(Environment* env, const char* main_script_id) {
783
756
env->context (), Undefined (env->isolate ()), arraysize (argv), argv));
784
757
}
785
758
786
- static void StartInspector (Environment* env, const char * path) {
787
- #if HAVE_INSPECTOR
788
- CHECK (!env->inspector_agent ()->IsListening ());
789
- v8_platform.StartInspector (env, path);
790
- #endif // HAVE_INSPECTOR
791
- }
792
-
793
759
794
760
#ifdef __POSIX__
795
761
void RegisterSignalHandler (int signal,
@@ -1289,13 +1255,24 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data,
1289
1255
Environment env (isolate_data, context);
1290
1256
env.Start (args, exec_args, per_process::v8_is_profiling);
1291
1257
1292
- const char * path = args.size () > 1 ? args[1 ].c_str () : nullptr ;
1293
- StartInspector (&env, path);
1294
-
1258
+ #if HAVE_INSPECTOR && NODE_USE_V8_PLATFORM
1259
+ CHECK (!env.inspector_agent ()->IsListening ());
1260
+ // Inspector agent can't fail to start, but if it was configured to listen
1261
+ // right away on the websocket port and fails to bind/etc, this will return
1262
+ // false.
1263
+ env.inspector_agent ()->Start (args.size () > 1 ? args[1 ].c_str () : " " ,
1264
+ env.options ()->debug_options (),
1265
+ env.inspector_host_port (),
1266
+ true );
1295
1267
if (env.options ()->debug_options ().inspector_enabled &&
1296
- !v8_platform. InspectorStarted (&env )) {
1268
+ !env. inspector_agent ()-> IsListening ( )) {
1297
1269
return 12 ; // Signal internal error.
1298
1270
}
1271
+ #else
1272
+ // inspector_enabled can't be true if !HAVE_INSPECTOR or !NODE_USE_V8_PLATFORM
1273
+ // - the option parser should not allow that.
1274
+ CHECK (!env.options ()->debug_options ().inspector_enabled );
1275
+ #endif // HAVE_INSPECTOR && NODE_USE_V8_PLATFORM
1299
1276
1300
1277
{
1301
1278
Environment::AsyncCallbackScope callback_scope (&env);
0 commit comments