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 <[email protected]>

PR-URL: nodejs#32474
Reviewed-By: Anto Aravinth <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
jasnell authored and addaleax committed Mar 27, 2020
1 parent 1428a92 commit a057871
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 @@ -1378,7 +1378,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 a057871

Please sign in to comment.