Skip to content
Closed
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,8 @@ E('ERR_INVALID_PERFORMANCE_MARK',

// This should probably be a `TypeError`.
E('ERR_INVALID_PROTOCOL', 'Protocol "%s" not supported. Expected "%s"', Error);

// This should probably be a `TypeError`.
E('ERR_INVALID_REPL_EVAL_CONFIG',
'Cannot specify both "breakEvalOnSigint" and "eval" for REPL', Error);
'Cannot specify both "breakEvalOnSigint" and "eval" for REPL', TypeError);
E('ERR_INVALID_SYNC_FORK_INPUT',
'Asynchronous forks do not support Buffer, Uint8Array or string input: %s',
TypeError);
Expand Down
14 changes: 13 additions & 1 deletion test/parallel/test-repl-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,19 @@ assert.strictEqual(r2.rli.input, r2.inputStream);
assert.strictEqual(r2.rli.output, r2.outputStream);
assert.strictEqual(r2.rli.terminal, false);

// Verify that defaults are used when no arguments are provided
// 3, breakEvalOnSigint and eval supplied together should cause a throw
const r3 = () => repl.start({
breakEvalOnSigint: true,
eval: true
});

common.expectsError(r3, {
code: 'ERR_INVALID_REPL_EVAL_CONFIG',
type: TypeError,
message: 'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'
});

// 4, Verify that defaults are used when no arguments are provided
const r4 = repl.start();

assert.strictEqual(r4._prompt, '> ');
Expand Down