src: clean up WHATWG URL parser, round 2#12251
Closed
TimothyGu wants to merge 4 commits intonodejs:masterfrom
Closed
src: clean up WHATWG URL parser, round 2#12251TimothyGu wants to merge 4 commits intonodejs:masterfrom
TimothyGu wants to merge 4 commits intonodejs:masterfrom
Conversation
addaleax
approved these changes
Apr 9, 2017
src/node_url.cc
Outdated
Member
There was a problem hiding this comment.
Tbh this does feel a bit like overkill ;) Plain template <typename T> static inlines should do the job, right?
Member
There was a problem hiding this comment.
Or, actually, as much as I love templates… maybe this is not the right time to use them? ;)
Member
Author
There was a problem hiding this comment.
I'd still prefer to have some basic type-checking, but I agree the is_integral check is probably overkill. Opted for a static_assert on sizeof(T) instead.
src/node_url.cc
Outdated
Member
There was a problem hiding this comment.
Fwiw you don’t need to do the !! if you’re returning a bool anyway
Member
|
I have not yet had a chance to go into a full review but things look good so far. |
watilde
approved these changes
Apr 13, 2017
Member
|
@TimothyGu This would need a rebase :) |
84ea5f8 to
cd419d0
Compare
Member
Author
|
@addaleax done 😺 |
They are unused in the JS layer.
cd419d0 to
e8f1dcc
Compare
Member
Author
jasnell
approved these changes
Apr 17, 2017
jasnell
pushed a commit
that referenced
this pull request
Apr 17, 2017
* reduce indentation * refactor URL inlined methods * prefer templates over macros * do not export ARG_* flags in url binding PR-URL: #12251 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Member
|
Landed in ade80ee |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This batch has some pretty heavy-duty changes, so reviewing commit-by-commit is probably preferred.
Reduce indentation
For some reason the linter never caught it, but in all other source files namespaces do not affect indentation. Link to whitespace-free diff
Refactor
node_url.handnode_url.ccA lot of inlined functions and lookup tables never needed to be in the header. Now that the header is going to be used more frequently in other areas of the codebase, it is best these things go into the actual implementation file.
Prefer templates over macros
Many character checks were implemented as macros. Implement them as templatized inline functions for better type checking.
Do not export
ARG_*flags in url bindingThey are not used by the JS layer.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
src, url