From 4235f74a8e77beef802993093c5a8e733bcec480 Mon Sep 17 00:00:00 2001 From: Aviv Keller Date: Sat, 26 Oct 2024 16:06:40 -0400 Subject: [PATCH] fixup! Co-authored-by: Antoine du Hamel --- lib/internal/util.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/internal/util.js b/lib/internal/util.js index 7ec99db9598f5e..6143248149d6b7 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -176,8 +176,7 @@ function deprecate(fn, msg, code, useEmitSync) { } function deprecateInstantation(target, code, ...args) { - if (code !== undefined) - lazyValidateString()(code, 'code'); + assert(typeof code === 'string'); getDeprecationWarningEmitter(code, `Instantiating ${target.name} without the 'new' keyword has been deprecated.`, target)();