node/lib/internal/process
Joyee Cheung 614ca327c8 lib: add assertion for user ESM execution
Previously we only had an internal assertion to ensure certain
code is executed before any user-provided CJS is run. This patch
adds another assertion for ESM.

Note that this internal state is not updated during source text
module execution via vm because to run any code via vm, some
user JS code must have already been executed anyway.

In addition this patch moves the states into internal/modules/helpers
to avoid circular dependencies. Also moves toggling the states to
true *right before* user code execution instead of after in case
we are half-way in the execution when internals try to check them.

PR-URL: https://github.com/nodejs/node/pull/51748
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2024-02-27 12:10:12 +01:00
..
esm_loader.js module: remove useCustomLoadersIfPresent flag 2023-11-23 10:15:43 +01:00
execution.js esm: detect ESM syntax in ambiguous JavaScript 2023-10-23 08:19:41 +02:00
per_thread.js src: add process.loadEnvFile and util.parseEnv 2024-02-15 12:05:50 +01:00
permission.js permission: handle fs path traversal 2023-06-20 17:31:47 -03:00
policy.js policy: disable process.binding() when enabled 2023-08-09 14:29:06 -03:00
pre_execution.js lib: add assertion for user ESM execution 2024-02-27 12:10:12 +01:00
promises.js lib: add trailing commas in internal/process 2023-02-18 18:56:43 +01:00
report.js permission: v8.writeHeapSnapshot and process.report 2023-07-04 13:12:48 +00:00
signal.js errors: improve hideStackFrames 2023-11-14 09:18:05 +01:00
task_queues.js lib: add trailing commas in internal/process 2023-02-18 18:56:43 +01:00
warning.js src: add --disable-warning option 2023-11-29 09:46:34 -03:00
worker_thread_only.js lib: add trailing commas in internal/process 2023-02-18 18:56:43 +01:00