mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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: https://github.com/nodejs/node/pull/32474 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
1 parent
5d15dd3fe3
commit
7c0c4e9a7e
1 file changed
+1
-1
+1
-1
@@ -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;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user