★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/8e00f0d2a2Nouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
repl: fixup error message
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 8e00f0d2a2cd3a0617b1951beda86591a278621e
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/repl.js
@@ -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;
};

0 comments on commit 8e00f0d

Please sign in to comment.