From 7c0c4e9a7e7eb64e83c87abfbf2fec7f551ead61 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Tue, 24 Mar 2020 15:05:39 -0700 Subject: [PATCH] repl: fixup error message Use "cmd.action" instead of just "action" for ERR_INVALID_ARG_TYPE Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/32474 Reviewed-By: Anto Aravinth Reviewed-By: Anna Henningsen --- lib/repl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/repl.js b/lib/repl.js index 420b9558f99700..19272f2229c702 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -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; };