Skip to content

Commit

Permalink
Changed error code to ERR_INVALID_ARG_VALUE
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasrunge committed Dec 26, 2020
1 parent 75f113e commit bfc5cc7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/readline.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function Interface(input, output, completer, terminal) {
}

if (!(history instanceof Array)) {
throw new ERR_INVALID_OPT_VALUE.RangeError('history', history);
throw new ERR_INVALID_ARG_VALUE('history', history);
}

if (historySize === undefined) {
Expand Down
16 changes: 8 additions & 8 deletions test/parallel/test-readline-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ function assertCursorRowsAndCols(rli, rows, cols) {
history: 'not an array'
});
}, {
name: 'RangeError',
code: 'ERR_INVALID_OPT_VALUE'
name: 'TypeError',
code: 'ERR_INVALID_ARG_VALUE'
});

assert.throws(() => {
Expand All @@ -132,8 +132,8 @@ function assertCursorRowsAndCols(rli, rows, cols) {
history: 123
});
}, {
name: 'RangeError',
code: 'ERR_INVALID_OPT_VALUE'
name: 'TypeError',
code: 'ERR_INVALID_ARG_VALUE'
});

assert.throws(() => {
Expand All @@ -142,8 +142,8 @@ function assertCursorRowsAndCols(rli, rows, cols) {
history: {}
});
}, {
name: 'RangeError',
code: 'ERR_INVALID_OPT_VALUE'
name: 'TypeError',
code: 'ERR_INVALID_ARG_VALUE'
});

assert.throws(() => {
Expand All @@ -152,8 +152,8 @@ function assertCursorRowsAndCols(rli, rows, cols) {
history: true
});
}, {
name: 'RangeError',
code: 'ERR_INVALID_OPT_VALUE'
name: 'TypeError',
code: 'ERR_INVALID_ARG_VALUE'
});

// Constructor throws if historySize is not a positive number
Expand Down

0 comments on commit bfc5cc7

Please sign in to comment.