Skip to content

Commit 5ecc9db

Browse files
committed
url: fix constructor error message for URLPattern
1 parent 59f00d7 commit 5ecc9db

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/node_url_pattern.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ void URLPattern::New(const FunctionCallbackInfo<Value>& args) {
269269
options.has_value() ? &options.value() : nullptr);
270270

271271
if (!url_pattern) {
272-
THROW_ERR_INVALID_URL_PATTERN(env, "Failed to constuct URLPattern");
272+
THROW_ERR_INVALID_URL_PATTERN(env, "Failed to construct URLPattern");
273273
return;
274274
}
275275

test/parallel/test-urlpattern.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ throws(() => {
2626
}, {
2727
message: 'boom'
2828
});
29+
30+
throws(() => {
31+
new URLPattern('invalid value');
32+
}, /TypeError: Failed to construct URLPattern/);

0 commit comments

Comments
 (0)