From 687f30467b67db9f39334cd19faa484c20a4ab06 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 6 Mar 2019 12:53:04 +0100 Subject: [PATCH] process: call prepareMainThreadExecution in all main thread scripts PR-URL: https://github.com/nodejs/node/pull/26468 Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater --- lib/internal/main/print_bash_completion.js | 6 ++++++ lib/internal/main/print_help.js | 6 ++++++ lib/internal/main/prof_process.js | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/lib/internal/main/print_bash_completion.js b/lib/internal/main/print_bash_completion.js index 225ed3d2221c00..41ebf0c6063e5f 100644 --- a/lib/internal/main/print_bash_completion.js +++ b/lib/internal/main/print_bash_completion.js @@ -1,6 +1,10 @@ 'use strict'; const { options, aliases } = require('internal/options'); +const { + prepareMainThreadExecution +} = require('internal/bootstrap/pre_execution'); + function print(stream) { const all_opts = [...options.keys(), ...aliases.keys()]; @@ -18,6 +22,8 @@ function print(stream) { complete -F _node_complete node node_g`); } +prepareMainThreadExecution(); + markBootstrapComplete(); print(process.stdout); diff --git a/lib/internal/main/print_help.js b/lib/internal/main/print_help.js index ef1cb9ce4bb880..d34c412d1686b0 100644 --- a/lib/internal/main/print_help.js +++ b/lib/internal/main/print_help.js @@ -3,6 +3,10 @@ const { types } = internalBinding('options'); const hasCrypto = Boolean(process.versions.openssl); +const { + prepareMainThreadExecution +} = require('internal/bootstrap/pre_execution'); + const typeLookup = []; for (const key of Object.keys(types)) typeLookup[types[key]] = key; @@ -171,6 +175,8 @@ function print(stream) { stream.write('\nDocumentation can be found at https://nodejs.org/\n'); } +prepareMainThreadExecution(); + markBootstrapComplete(); print(process.stdout); diff --git a/lib/internal/main/prof_process.js b/lib/internal/main/prof_process.js index a1143cb201e79c..bd835bfe630fa4 100644 --- a/lib/internal/main/prof_process.js +++ b/lib/internal/main/prof_process.js @@ -1,4 +1,9 @@ 'use strict'; +const { + prepareMainThreadExecution +} = require('internal/bootstrap/pre_execution'); + +prepareMainThreadExecution(); markBootstrapComplete(); require('internal/v8_prof_processor');