From efce655c0f1671d0e86b5c89092ac93db983ef94 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 10 Nov 2019 16:59:16 +0800 Subject: module: reduce circular dependency of internal/modules/cjs/loader Previously `internal/bootstrap/pre_execution.js` requires `internal/modules/cjs/loader.js` which in turn requires `internal/bootstrap/pre_execution.js`. This patch moves the entry point execution logic out of `pre_execution.js` and puts it into `internal/modules/run_main.js`. It also tests that `Module.runMain` can be monkey-patched before further deprecation/refactoring can be done. Also added an internal assertion `hasLoadedAnyUserCJSModule` for documentation purposes. PR-URL: https://github.com/nodejs/node/pull/30349 Reviewed-By: Guy Bedford Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- node.gyp | 1 + 1 file changed, 1 insertion(+) (limited to 'node.gyp') diff --git a/node.gyp b/node.gyp index d37be3141b..9ae69e01df 100644 --- a/node.gyp +++ b/node.gyp @@ -145,6 +145,7 @@ 'lib/internal/main/run_main_module.js', 'lib/internal/main/run_third_party_main.js', 'lib/internal/main/worker_thread.js', + 'lib/internal/modules/run_main.js', 'lib/internal/modules/cjs/helpers.js', 'lib/internal/modules/cjs/loader.js', 'lib/internal/modules/esm/loader.js', -- cgit v1.2.3