@@ -330,6 +330,19 @@ void FreeIsolateData(IsolateData* isolate_data) {
330
330
delete isolate_data;
331
331
}
332
332
333
+ InspectorParentHandle::~InspectorParentHandle () {}
334
+
335
+ // Hide the internal handle class from the public API.
336
+ #if HAVE_INSPECTOR
337
+ struct InspectorParentHandleImpl : public InspectorParentHandle {
338
+ std::unique_ptr<inspector::ParentInspectorHandle> impl;
339
+
340
+ explicit InspectorParentHandleImpl (
341
+ std::unique_ptr<inspector::ParentInspectorHandle>&& impl)
342
+ : impl(std::move(impl)) {}
343
+ };
344
+ #endif
345
+
333
346
Environment* CreateEnvironment (IsolateData* isolate_data,
334
347
Local<Context> context,
335
348
int argc,
@@ -348,7 +361,8 @@ Environment* CreateEnvironment(
348
361
const std::vector<std::string>& args,
349
362
const std::vector<std::string>& exec_args,
350
363
EnvironmentFlags::Flags flags,
351
- ThreadId thread_id) {
364
+ ThreadId thread_id,
365
+ std::unique_ptr<InspectorParentHandle> inspector_parent_handle) {
352
366
Isolate* isolate = context->GetIsolate ();
353
367
HandleScope handle_scope (isolate);
354
368
Context::Scope context_scope (context);
@@ -365,6 +379,16 @@ Environment* CreateEnvironment(
365
379
env->set_abort_on_uncaught_exception (false );
366
380
}
367
381
382
+ #if HAVE_INSPECTOR
383
+ if (inspector_parent_handle) {
384
+ env->InitializeInspector (
385
+ std::move (static_cast <InspectorParentHandleImpl*>(
386
+ inspector_parent_handle.get ())->impl ));
387
+ } else {
388
+ env->InitializeInspector ({});
389
+ }
390
+ #endif
391
+
368
392
if (env->RunBootstrapping ().IsEmpty ()) {
369
393
FreeEnvironment (env);
370
394
return nullptr ;
@@ -394,19 +418,6 @@ void FreeEnvironment(Environment* env) {
394
418
delete env;
395
419
}
396
420
397
- InspectorParentHandle::~InspectorParentHandle () {}
398
-
399
- // Hide the internal handle class from the public API.
400
- #if HAVE_INSPECTOR
401
- struct InspectorParentHandleImpl : public InspectorParentHandle {
402
- std::unique_ptr<inspector::ParentInspectorHandle> impl;
403
-
404
- explicit InspectorParentHandleImpl (
405
- std::unique_ptr<inspector::ParentInspectorHandle>&& impl)
406
- : impl(std::move(impl)) {}
407
- };
408
- #endif
409
-
410
421
NODE_EXTERN std::unique_ptr<InspectorParentHandle> GetInspectorParentHandle (
411
422
Environment* env,
412
423
ThreadId thread_id,
@@ -430,27 +441,17 @@ void LoadEnvironment(Environment* env) {
430
441
MaybeLocal<Value> LoadEnvironment (
431
442
Environment* env,
432
443
StartExecutionCallback cb,
433
- std::unique_ptr<InspectorParentHandle> inspector_parent_handle ) {
444
+ std::unique_ptr<InspectorParentHandle> removeme ) {
434
445
env->InitializeLibuv (per_process::v8_is_profiling);
435
446
env->InitializeDiagnostics ();
436
447
437
- #if HAVE_INSPECTOR
438
- if (inspector_parent_handle) {
439
- env->InitializeInspector (
440
- std::move (static_cast <InspectorParentHandleImpl*>(
441
- inspector_parent_handle.get ())->impl ));
442
- } else {
443
- env->InitializeInspector ({});
444
- }
445
- #endif
446
-
447
448
return StartExecution (env, cb);
448
449
}
449
450
450
451
MaybeLocal<Value> LoadEnvironment (
451
452
Environment* env,
452
453
const char * main_script_source_utf8,
453
- std::unique_ptr<InspectorParentHandle> inspector_parent_handle ) {
454
+ std::unique_ptr<InspectorParentHandle> removeme ) {
454
455
CHECK_NOT_NULL (main_script_source_utf8);
455
456
return LoadEnvironment (
456
457
env,
@@ -475,8 +476,7 @@ MaybeLocal<Value> LoadEnvironment(
475
476
env->process_object (),
476
477
env->native_module_require ()};
477
478
return ExecuteBootstrapper (env, name.c_str (), ¶ms, &args);
478
- },
479
- std::move (inspector_parent_handle));
479
+ });
480
480
}
481
481
482
482
Environment* GetCurrentEnvironment (Local<Context> context) {
0 commit comments