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 addaleax committed Mar 30, 2020
1 parent 7f0ed89 commit 8e00f0d
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 @@ -1380,7 +1380,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 8e00f0d

Please sign in to comment.