Repository navigation
src: add node::url::URL::href() method #22610
Description
Activity
- addedhelp wantedIssues that need assistance from volunteers or PRs that need help to proceed.Issues that need assistance from volunteers or PRs that need help to proceed.lib / srcIssues and PRs involving general changes in the lib/ or src/ directories.Issues and PRs involving general changes in the lib/ or src/ directories.
on Aug 31, 2018 - addedwhatwg-urlIssues and PRs related to the WHATWG URL implementation.Issues and PRs related to the WHATWG URL implementation.and removedlib / srcIssues and PRs involving general changes in the lib/ or src/ directories.Issues and PRs involving general changes in the lib/ or src/ directories.
on Sep 3, 2018 @nodejs/url
the url serializer is written in js, so i'm not 100% sure if this is possible without a lot of code duplication
@devsnek Yeah my guess is that we will have to duplicate. That's fine though, as we already have a duplicated
URLclass in C++ anyway.Are there any specs for
URL::href()?I am not sure if is this one
https://url.spec.whatwg.org/#dom-url-href@tigercosmos Yes! You can even look at how lib/internal/url.js implements it in JavaScript, and just duplicate that logic in C++.
Hi @ak239
I think you can use toString() also?
They both return the same result.I'm taking over this issue
Reacted by Liu, An-ChiReacted by Michaël Zasso@stropitek As @WaleedAshraf commented, this might not be necessary since
ToString()also works… just as a heads up, so you don’t do unnecessary work :)Reacted by Waleed AshrafMay be worth it to dig deeper to verify if
ToString()actually exists and works in C++.If it does to remove this TODO and update to use the
ToString()function.
https://github.com/ak239/node/blob/master/src/inspector_agent.cc#L622No the
ToStringmethod exists onURLHostclass not on theURLclass.Reacted by Waleed AshrafIs this being actively worked on?
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Nov 18, 2018 @ak239 This is still something you want/need? Or did you find some other workaround?
There is no URL::ToString method and AFAIK @stropitek has a wip branch to add it
Reacted by Waleed AshrafYup. That's
URLHostnotURL. We were confused.Reacted by Michaël ZassoThere is no URL::ToString method and AFAIK @stropitek has a wip branch to add it
Would it make sense to open a WIP PR?
As far as I remember the motivation behind this one was driven by one of the comments in the code review for one of my PRs: #22251 (comment)
It looks like there were no other requests for href getter over the last year and a half so I will close this one. Feel free to reopen it if you think that we need href getter.- added a commit that references this issue
on Nov 21, 2020 - added a commit that references this issue
on Nov 22, 2020
Is your feature request related to a problem? Please describe.
I need to get href based on instance of URL object in native code.
Describe the solution you'd like
I can use href() method that is added in addition to existing getters.