From 705935d62059d92543cda43c8cdb29bc34082d5e Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Fri, 12 Apr 2019 17:22:59 +0200 Subject: [PATCH] assert: fix backport regression This fixes a regression for an error case with `assert.rejects` and `assert.doesNotReject`. Fixes: https://github.com/nodejs/node/issues/27185 PR-URL: https://github.com/nodejs/node/pull/27202 Reviewed-By: Luigi Pinca Reviewed-By: Beth Griggs --- lib/assert.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/assert.js b/lib/assert.js index e29a381acb746d..4cab918e6a74e9 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -720,7 +720,8 @@ function getActual(block) { async function waitForActual(block) { if (typeof block !== 'function') { - throw new errors.ERR_INVALID_ARG_TYPE('block', 'Function', block); + throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'block', 'Function', + block); } // Return a rejected promise if `block` throws synchronously.