Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url: stricter domainTo*() argument checking #12134

Closed
wants to merge 1 commit into from

Conversation

@TimothyGu
Copy link
Member

commented Mar 30, 2017

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

url

@@ -1308,11 +1308,17 @@ function originFor(url, base) {
}

function domainToASCII(domain) {
if (arguments.length < 1)

This comment has been minimized.

Copy link
@cjihrig

cjihrig Mar 30, 2017

Contributor

Can you change these to checks against domain explicitly. No need to introduce arguments for no reason.

This comment has been minimized.

Copy link
@TimothyGu

TimothyGu Apr 1, 2017

Author Member

That would be against the semantics used by other WHATWG URL interface methods. Why the aversion to arguments in this case? arguments.length is perfectly fine and optimizable by V8.

This comment has been minimized.

Copy link
@joyeecheung

joyeecheung Apr 1, 2017

Member

Since url.host = undefined actually sets the domain to "undefined"...it makes sense for domainTo* too so arguments.length is needed

@watilde
watilde approved these changes Apr 3, 2017
@jasnell
jasnell approved these changes Apr 3, 2017

Rationale for arguments.length has been explained.

@TimothyGu TimothyGu force-pushed the TimothyGu:url-domainto-noarg branch to 03a3909 Apr 4, 2017

@TimothyGu

This comment has been minimized.

Copy link
Member Author

commented Apr 4, 2017

jasnell added a commit that referenced this pull request Apr 4, 2017
url: error when domainTo*() is called w/o argument
PR-URL: #12134
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell

This comment has been minimized.

Copy link
Member

commented Apr 4, 2017

Landed in c4469c4

@jasnell jasnell closed this Apr 4, 2017

@TimothyGu TimothyGu deleted the TimothyGu:url-domainto-noarg branch Apr 4, 2017

@jasnell jasnell referenced this pull request Apr 4, 2017
@italoacasas

This comment has been minimized.

Copy link
Member

commented Apr 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
8 participants
You can’t perform that action at this time.