From 9e80fb10cc5f5689bcf0584d455ac512de257feb Mon Sep 17 00:00:00 2001 From: tsctx <91457664+tsctx@users.noreply.github.com> Date: Thu, 23 Nov 2023 21:36:04 +0900 Subject: [PATCH] refactor: add missing new operator (#2452) --- lib/fetch/request.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fetch/request.js b/lib/fetch/request.js index 60e654eca11..336d361ce20 100644 --- a/lib/fetch/request.js +++ b/lib/fetch/request.js @@ -316,11 +316,11 @@ class Request { // 2. If method is not a method or method is a forbidden method, then // throw a TypeError. if (!isValidHTTPToken(init.method)) { - throw TypeError(`'${init.method}' is not a valid HTTP method.`) + throw new TypeError(`'${init.method}' is not a valid HTTP method.`) } if (forbiddenMethodsSet.has(method.toUpperCase())) { - throw TypeError(`'${init.method}' HTTP method is unsupported.`) + throw new TypeError(`'${init.method}' HTTP method is unsupported.`) } // 3. Normalize method.