From a89cd5caab1432ef464442ad1f31998f2a54c050 Mon Sep 17 00:00:00 2001 From: Ayush Gupta Date: Tue, 10 Apr 2018 13:10:57 +0530 Subject: [PATCH] errors: pass missing `message` parameter to `internalAssert` Passes the `message` parameter to `internalAssert` when `ERR_INVALID_ARG_TYPE` is thrown with invalid arguments. --- lib/internal/errors.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/errors.js b/lib/internal/errors.js index 99ffb46783b8cb..b190ae32bf6c8f 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -959,8 +959,8 @@ E('ERR_VM_MODULE_STATUS', 'Module status %s', Error); E('ERR_ZLIB_INITIALIZATION_FAILED', 'Initialization failed', Error); function invalidArgType(name, expected, actual) { - internalAssert(typeof name === 'string'); - internalAssert(arguments.length === 3); + internalAssert(arguments.length === 3, 'Exactly 3 arguments are required'); + internalAssert(typeof name === 'string', 'name must be a string'); // determiner: 'must be' or 'must not be' let determiner;