mirror of
https://github.com/nodejs/node.git
synced 2025-08-17 14:48:58 +02:00

Previously we wrapped the embedder entry point callback into a binding and then invoke the binding from JS land which was a bit convoluted. Now we just call it directly from C++. The main scripts that needed to tail call the embedder callback now return the arguments in an array so that the C++ land can extract the arguments and pass them to the callback. We also set `PauseOnNextJavascriptStatement()` for --inspect-brk and mark the bootstrap complete milestone directly in C++ for these execution modes. PR-URL: https://github.com/nodejs/node/pull/51557 Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
15 lines
505 B
JavaScript
15 lines
505 B
JavaScript
'use strict';
|
|
const {
|
|
prepareMainThreadExecution,
|
|
} = require('internal/process/pre_execution');
|
|
const { isExperimentalSeaWarningNeeded } = internalBinding('sea');
|
|
const { emitExperimentalWarning } = require('internal/util');
|
|
const { embedderRequire, embedderRunCjs } = require('internal/util/embedding');
|
|
|
|
prepareMainThreadExecution(false, true);
|
|
|
|
if (isExperimentalSeaWarningNeeded()) {
|
|
emitExperimentalWarning('Single executable application');
|
|
}
|
|
|
|
return [process, embedderRequire, embedderRunCjs];
|