From 65392be66560616e79c9c958bb7c4a7b53e3dffc Mon Sep 17 00:00:00 2001 From: Ankur Oberoi Date: Mon, 17 Dec 2018 17:18:55 -0800 Subject: [PATCH] util: fixes type in argument type validation error PR-URL: https://github.com/nodejs/node/pull/25103 Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen --- lib/util.js | 2 +- test/parallel/test-util-inherits.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util.js b/lib/util.js index fb15b0bfa0549d..1c82dc956d5ba5 100644 --- a/lib/util.js +++ b/lib/util.js @@ -281,7 +281,7 @@ function inherits(ctor, superCtor) { if (superCtor.prototype === undefined) { throw new ERR_INVALID_ARG_TYPE('superCtor.prototype', - 'Function', superCtor.prototype); + 'Object', superCtor.prototype); } ctor.super_ = superCtor; Object.setPrototypeOf(ctor.prototype, superCtor.prototype); diff --git a/test/parallel/test-util-inherits.js b/test/parallel/test-util-inherits.js index d37cb6bf8b73e4..fec27bc9159640 100644 --- a/test/parallel/test-util-inherits.js +++ b/test/parallel/test-util-inherits.js @@ -80,7 +80,7 @@ common.expectsError(function() { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "superCtor.prototype" property must be of type Function. ' + + message: 'The "superCtor.prototype" property must be of type Object. ' + 'Received type undefined' });