From 5ecc9db2f8108e8b9ea9b88cd61cbd9b42e606d2 Mon Sep 17 00:00:00 2001 From: jakecastelli Date: Sat, 15 Mar 2025 20:58:10 +1030 Subject: [PATCH 1/3] url: fix constructor error message for URLPattern --- src/node_url_pattern.cc | 2 +- test/parallel/test-urlpattern.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/node_url_pattern.cc b/src/node_url_pattern.cc index 239e502841a03b..25730edf4cf90e 100644 --- a/src/node_url_pattern.cc +++ b/src/node_url_pattern.cc @@ -269,7 +269,7 @@ void URLPattern::New(const FunctionCallbackInfo& args) { options.has_value() ? &options.value() : nullptr); if (!url_pattern) { - THROW_ERR_INVALID_URL_PATTERN(env, "Failed to constuct URLPattern"); + THROW_ERR_INVALID_URL_PATTERN(env, "Failed to construct URLPattern"); return; } diff --git a/test/parallel/test-urlpattern.js b/test/parallel/test-urlpattern.js index 1a8d722c5d3e87..7f582b0bfde74a 100644 --- a/test/parallel/test-urlpattern.js +++ b/test/parallel/test-urlpattern.js @@ -26,3 +26,7 @@ throws(() => { }, { message: 'boom' }); + +throws(() => { + new URLPattern('invalid value'); +}, /TypeError: Failed to construct URLPattern/); From 79acb79393d20d69f1f17223dfa2a97a7bd7ed8c Mon Sep 17 00:00:00 2001 From: jakecastelli <38635403+jakecastelli@users.noreply.github.com> Date: Sun, 16 Mar 2025 11:14:25 +1030 Subject: [PATCH 2/3] remove test for error message Co-authored-by: Yagiz Nizipli --- test/parallel/test-urlpattern.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/parallel/test-urlpattern.js b/test/parallel/test-urlpattern.js index 7f582b0bfde74a..33f687a2438ed8 100644 --- a/test/parallel/test-urlpattern.js +++ b/test/parallel/test-urlpattern.js @@ -27,6 +27,3 @@ throws(() => { message: 'boom' }); -throws(() => { - new URLPattern('invalid value'); -}, /TypeError: Failed to construct URLPattern/); From 2352bef3bcd52e13495bc9b6ca2f75bab2bc60b8 Mon Sep 17 00:00:00 2001 From: jakecastelli <38635403+jakecastelli@users.noreply.github.com> Date: Sun, 16 Mar 2025 11:27:11 +1030 Subject: [PATCH 3/3] Update test/parallel/test-urlpattern.js Co-authored-by: Yagiz Nizipli --- test/parallel/test-urlpattern.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/parallel/test-urlpattern.js b/test/parallel/test-urlpattern.js index 33f687a2438ed8..1a8d722c5d3e87 100644 --- a/test/parallel/test-urlpattern.js +++ b/test/parallel/test-urlpattern.js @@ -26,4 +26,3 @@ throws(() => { }, { message: 'boom' }); -