0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/lib/internal/main/eval_stdin.js
Joyee Cheung 84000835e2
process: group main thread execution preparation code
This patch groups the preparation of main thread execution into
`prepareMainThreadExecution()` and removes the cluster IPC
setup in worker thread bootstrap since clusters do not use
worker threads for its implementation and it's unlikely to change.

PR-URL: https://github.com/nodejs/node/pull/26000
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-02-10 16:33:57 +08:00

21 lines
407 B
JavaScript

'use strict';
// Stdin is not a TTY, we will read it and execute it.
const {
prepareMainThreadExecution
} = require('internal/bootstrap/pre_execution');
const {
evalScript,
readStdin
} = require('internal/process/execution');
prepareMainThreadExecution();
markBootstrapComplete();
readStdin((code) => {
process._eval = code;
evalScript('[stdin]', process._eval, process._breakFirstLine);
});