src, url: WHATWG URL C++ parser cleanup#11917
src, url: WHATWG URL C++ parser cleanup#11917TimothyGu wants to merge 3 commits intonodejs:masterfrom
Conversation
src/node_url.cc
Outdated
There was a problem hiding this comment.
The scheme state handling seems to deviate quite a bit from the spec now?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
src/node_url.cc
Outdated
There was a problem hiding this comment.
Better leave a handle for it...like XXX(TimothyGu):
There was a problem hiding this comment.
nit: Can you just make this TODO(TimothyGu):
src/node_url.cc
Outdated
There was a problem hiding this comment.
nit: Can you just make this TODO(TimothyGu):
|
This will need a rebase. |
|
I'll say this is currently blocked on #11934 as it will change TERMINATED and FAILED handling. |
|
@jasnell, @joyeecheung, rebased. PTAL. |
src/node_url.cc
Outdated
There was a problem hiding this comment.
Eventually it would likely be better just to inline this and get rid of the macro
jasnell
left a comment
There was a problem hiding this comment.
Generally LGTM with a couple of suggestions
src/node_url.h
Outdated
There was a problem hiding this comment.
Likely worthwhile to decrement each of the remaining flags accordingly so that there's not a gap.
There was a problem hiding this comment.
Fixed. I was planning on some more refactoring, but that didn't happen.
|
Is this ready to go? |
|
@jasnell, go ahead with landing this if you'd like to. I've been busy the last couple of days. |
|
Rebased and one last CI: https://ci.nodejs.org/job/node-test-pull-request/7099/ |
Do not call any completion callback with TERMINATED.
|
Landed in 4ddd23f. |
- Clarify port state - Remove scheme flag - Clarify URL_FLAG_TERMINATED PR-URL: #11917 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
|
cc @TimothyGu |
Some general housekeeping for the WHATWG URL implementation.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
src, url