From 5771dc411c1b50433ac7fc1ed84b526e698b0469 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 624f4dfb7d032b..82c92ad0be47cf 100644 --- a/lib/util.js +++ b/lib/util.js @@ -303,7 +303,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' });