Skip to content

src, url: WHATWG URL C++ parser cleanup - #11917

Closed
TimothyGu wants to merge 3 commits into
nodejs:masterfrom
TimothyGu:url-cleanup
Closed

src, url: WHATWG URL C++ parser cleanup#11917
TimothyGu wants to merge 3 commits into
nodejs:masterfrom
TimothyGu:url-cleanup

Conversation

@TimothyGu

Copy link
Copy Markdown
Member

Some general housekeeping for the WHATWG URL implementation.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

src, url

@TimothyGuTimothyGu added c++ Issues and PRs that require attention from people who are familiar with C++. whatwg-url Issues and PRs related to the WHATWG URL implementation. labels Mar 18, 2017
@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. dont-land-on-v4.x whatwg-url Issues and PRs related to the WHATWG URL implementation. labels Mar 18, 2017
@TimothyGu

Copy link
Copy Markdown
MemberAuthor

Comment threadsrc/node_url.cc Outdated

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.

The scheme state handling seems to deviate quite a bit from the spec now?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

That is unfortunately true. We already deviate from the spec by storing : as part of the scheme, coupled by the fact that we delegate some responsibilities to the JS layer, it's hard to follow the spec word-for-word.

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.

As long as we're still API compliant and passing all the tests, such deviation is fine. It would be helpful, however, to document the deviations in code comments.

Comment threadsrc/node_url.cc Outdated

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.

Better leave a handle for it...like XXX(TimothyGu):

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.

nit: Can you just make this TODO(TimothyGu):

@jasnelljasnell self-assigned this Mar 21, 2017

@jasnelljasnell left a comment

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.

Generally LGTM

Comment threadsrc/node_url.cc Outdated

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.

nit: Can you just make this TODO(TimothyGu):

@jasnell

Copy link
Copy Markdown
Member

This will need a rebase.

@TimothyGu

Copy link
Copy Markdown
MemberAuthor

I'll say this is currently blocked on #11934 as it will change TERMINATED and FAILED handling.

@TimothyGuTimothyGu added the blocked PRs that are blocked by other issues or PRs. label Mar 22, 2017
@TimothyGuTimothyGu removed the blocked PRs that are blocked by other issues or PRs. label Mar 23, 2017
@TimothyGu

Copy link
Copy Markdown
MemberAuthor

@jasnell, @joyeecheung, rebased. PTAL.

Comment threadsrc/node_url.cc Outdated

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.

Eventually it would likely be better just to inline this and get rid of the macro

@jasnelljasnell left a comment

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.

Generally LGTM with a couple of suggestions

Comment threadsrc/node_url.h Outdated

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.

Likely worthwhile to decrement each of the remaining flags accordingly so that there's not a gap.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Fixed. I was planning on some more refactoring, but that didn't happen.

@jasnell

Copy link
Copy Markdown
Member

Is this ready to go?

@jasnelljasnell added this to the 8.0.0 milestone Mar 27, 2017
@TimothyGu

Copy link
Copy Markdown
MemberAuthor

@jasnell, go ahead with landing this if you'd like to. I've been busy the last couple of days.

@jasnell

Copy link
Copy Markdown
Member

@TimothyGu

Copy link
Copy Markdown
MemberAuthor

Rebased and one last CI: https://ci.nodejs.org/job/node-test-pull-request/7099/

Do not call any completion callback with TERMINATED.
@TimothyGu

Copy link
Copy Markdown
MemberAuthor

Landed in 4ddd23f.

@TimothyGu
TimothyGu deleted the url-cleanup branch March 30, 2017 05:20
TimothyGu added a commit that referenced this pull request Mar 30, 2017
- Clarify port state
- Remove scheme flag
- Clarify URL_FLAG_TERMINATED
PR-URL: #11917
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@jasnelljasnell mentioned this pull request Apr 4, 2017
@italoacasas

Copy link
Copy Markdown

cc @TimothyGu

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++Issues and PRs that require attention from people who are familiar with C++.whatwg-urlIssues and PRs related to the WHATWG URL implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@TimothyGu@jasnell@italoacasas@joyeecheung@nodejs-github-bot