Skip to content

url: add Symbol.toStringTag to URLPattern - #65925

Open
XadillaX wants to merge 1 commit into
nodejs:mainfrom
XadillaX:fix-urlpattern-tostringtag
Open

url: add Symbol.toStringTag to URLPattern#65925
XadillaX wants to merge 1 commit into
nodejs:mainfrom
XadillaX:fix-urlpattern-tostringtag

Conversation

@XadillaX

@XadillaX XadillaX commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Define Symbol.toStringTag on URLPattern.prototype so that the class string matches the Web IDL interface name. Add regression coverage for the property descriptor and Object.prototype.toString() result.

Fixes: #65924

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/url

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. whatwg-url Issues and PRs related to the WHATWG URL implementation. labels Sep 9, 2026
@meixg meixg added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 9, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 9, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.17%. Comparing base (cb9b870) to head (90a0e33).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65925      +/-   ##
==========================================
- Coverage   92.40%   90.17%   -2.24%     
==========================================
  Files         417      771     +354     
  Lines      188989   265489   +76500     
  Branches    28924    50467   +21543     
==========================================
+ Hits       174642   239393   +64751     
- Misses      14015    17045    +3030     
- Partials      332     9051    +8719     
Files with missing lines Coverage Δ
src/node_url_pattern.cc 83.52% <100.00%> (ø)

... and 483 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@panva panva added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 9, 2026
@avivkeller avivkeller added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 9, 2026
@aduh95 aduh95 added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. and removed request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Sep 9, 2026
Comment thread src/node_url_pattern.cc Outdated
ctor_tmpl->SetClassName(FIXED_ONE_BYTE_STRING(isolate, "URLPattern"));
prototype_template->Set(
v8::Symbol::GetToStringTag(isolate),
FIXED_ONE_BYTE_STRING(isolate, "URLPattern"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just create the URLPattern string once and use it both in SetClassName and the call to Set.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. The URLPattern string is now created once and reused for both SetClassName() and Symbol.toStringTag.

Define Symbol.toStringTag on URLPattern.prototype so its class string
matches the Web IDL interface name.

Add coverage for the property descriptor and
Object.prototype.toString().

Fixes: nodejs#65924
Signed-off-by: XadillaX <i@2333.moe>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. whatwg-url Issues and PRs related to the WHATWG URL implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Symbol.toStringTag on URLPattern

9 participants