From fe1e8ea709f6dfd4eeda7004c5868e0639b9465f 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 --- 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 ef28427cd87bc8..4d65e63ff36ab7 100644 --- a/lib/util.js +++ b/lib/util.js @@ -317,7 +317,7 @@ function inherits(ctor, superCtor) { if (superCtor.prototype === undefined) { throw new ERR_INVALID_ARG_TYPE('superCtor.prototype', - 'Function', superCtor.prototype); + 'Object', superCtor.prototype); } Object.defineProperty(ctor, 'super_', { value: superCtor, diff --git a/test/parallel/test-util-inherits.js b/test/parallel/test-util-inherits.js index 9bbb4352dc3853..ed0800c33cec42 100644 --- a/test/parallel/test-util-inherits.js +++ b/test/parallel/test-util-inherits.js @@ -88,7 +88,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' });