Skip to content
Prev Previous commit
Next Next commit
bootstrap complete before user code
  • Loading branch information
guybedford committed Oct 14, 2019
commit 76b41531c4d28846e167b59da08f2bc28dcb5084
5 changes: 3 additions & 2 deletions lib/internal/main/run_main_module.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const {
prepareMainThreadExecution(true);

const runMainAsync = require('internal/main/main');

markBootstrapComplete();

const asyncMain = runMainAsync(process.argv[1]);

// Sync runMain. Async case hands over control to the promise chain.
Expand All @@ -16,5 +19,3 @@ if (!asyncMain) {
const CJSModule = require('internal/modules/cjs/loader').Module;
CJSModule.runMain(process.argv[1]);
}

markBootstrapComplete();