Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/internal/bootstrap_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,12 @@

} else if (!process._allowRepl &&
NativeModule.require('tty').isatty(0)) {
if (process._eval != null) {
// User passed '-e' or '--eval'
evalScript('[eval]');
}
// We are on an interactive terminal but don't allow the REPL to
// start. This is the usual case if Node is used as a shared library.
// Calling evalScript is necessary however, because it sets
// globals.require to the require function.
// Otherwise, require doesn't work.
evalScript('[eval]');
} else {
// Read all of stdin - execute it.
process.stdin.setEncoding('utf8');
Expand Down