node/lib/internal/main/inspect.js
Joyee Cheung 06f5d45647
bootstrap: support more builtins in the embedded code cache
This patch:

- Make NativeModuleLoader::LookupAndCompile() detect parameters based
  on module IDs. This allows us to compile more builtins when
  generating the embedded bootstrap, including
  - internal/per_context/*
  - internal/bootstrap/*
  - internal/main/*
- Move pre_execution.js to lib/internal/process as it needs to be
  compiled as a regular built-in module, unlike other scripts
  in lib/internal/bootstrap
- Move markBootstrapComplete() to the performance binding instead of
  making it a function-wrapper-based global to reduce number of
  special cases.

PR-URL: https://github.com/nodejs/node/pull/44018
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2022-08-05 01:11:20 +08:00

19 lines
332 B
JavaScript

'use strict';
// `node inspect ...` or `node debug ...`
const {
prepareMainThreadExecution,
markBootstrapComplete
} = require('internal/process/pre_execution');
prepareMainThreadExecution();
markBootstrapComplete();
// Start the debugger agent.
process.nextTick(() => {
require('internal/debugger/inspect').start();
});