Skip to content

Commit

Permalink
repl: fixup error message
Browse files Browse the repository at this point in the history
Use "cmd.action" instead of just "action" for ERR_INVALID_ARG_TYPE

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: #32474
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
jasnell authored and targos committed Apr 22, 2020
1 parent 5d15dd3 commit 7c0c4e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@ REPLServer.prototype.defineCommand = function(keyword, cmd) {
if (typeof cmd === 'function') {
cmd = { action: cmd };
} else if (typeof cmd.action !== 'function') {
throw new ERR_INVALID_ARG_TYPE('action', 'Function', cmd.action);
throw new ERR_INVALID_ARG_TYPE('cmd.action', 'Function', cmd.action);
}
this.commands[keyword] = cmd;
};
Expand Down

0 comments on commit 7c0c4e9

Please sign in to comment.