Skip to content

Commit

Permalink
process: call prepareMainThreadExecution in all main thread scripts
Browse files Browse the repository at this point in the history
PR-URL: nodejs#26468
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
joyeecheung committed Mar 8, 2019
1 parent 21440c8 commit 687f304
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/internal/main/print_bash_completion.js
Original file line number Diff line number Diff line change
@@ -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()];

Expand All @@ -18,6 +22,8 @@ function print(stream) {
complete -F _node_complete node node_g`);
}

prepareMainThreadExecution();

markBootstrapComplete();

print(process.stdout);
6 changes: 6 additions & 0 deletions lib/internal/main/print_help.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -171,6 +175,8 @@ function print(stream) {
stream.write('\nDocumentation can be found at https://nodejs.org/\n');
}

prepareMainThreadExecution();

markBootstrapComplete();

print(process.stdout);
5 changes: 5 additions & 0 deletions lib/internal/main/prof_process.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
'use strict';

const {
prepareMainThreadExecution
} = require('internal/bootstrap/pre_execution');

prepareMainThreadExecution();
markBootstrapComplete();
require('internal/v8_prof_processor');

0 comments on commit 687f304

Please sign in to comment.