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: replace "magic" numbers by constants #19035

Closed
wants to merge 1 commit into from

Conversation

daynin
Copy link
Contributor

@daynin daynin commented Feb 27, 2018

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

url

@nodejs-github-bot nodejs-github-bot added the url Issues and PRs related to the legacy built-in url module. label Feb 27, 2018
@watilde
Copy link
Member

watilde commented Feb 27, 2018

Copy link
Contributor

@MylesBorins MylesBorins left a comment

Choose a reason for hiding this comment

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

rubber stamp LGTM if CI passes

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

These changes LGTM, but it seems like there are still quite a few magic numbers in lib/url.js. For example, https://github.com/daynin/node/blob/32c3cb1c145a25efffb2f353d4db314b7952f6ca/lib/url.js#L276-L291

@daynin
Copy link
Contributor Author

daynin commented Feb 28, 2018

@cjihrig I replaced remain numbers

@daynin daynin changed the title url: replace "magic" numbers by contstants url: replace "magic" numbers by constants Feb 28, 2018
@watilde
Copy link
Member

watilde commented Feb 28, 2018

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 1, 2018
Copy link
Member

@apapirovski apapirovski left a comment

Choose a reason for hiding this comment

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

LGTM but there's an incorrect comment that has to be fixed before landing.

CHAR_EXCLAMATION_MARK: 33, /* ! */
CHAR_HASH: 35, /* # */
CHAR_SPACE: 32, /* */
CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \u00A0 */
Copy link
Member

Choose a reason for hiding this comment

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

This should be commented as \uFEFF, not \u00A0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@apapirovski fixed

@apapirovski apapirovski removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 4, 2018
@daynin daynin force-pushed the url-add-constants branch from ccc8b07 to 44d723b Compare March 4, 2018 16:00
@daynin
Copy link
Contributor Author

daynin commented Mar 6, 2018

/cc @nodejs/collaborators

Hello! Run CI for this PR, please

@devsnek devsnek added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 6, 2018
@devsnek
Copy link
Member

devsnek commented Mar 6, 2018

CI https://ci.nodejs.org/job/node-test-pull-request/13529/

@BridgeAR
Copy link
Member

Landed in 2f74326 🎉

@BridgeAR BridgeAR closed this Mar 11, 2018
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Mar 11, 2018
PR-URL: nodejs#19035
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
PR-URL: #19035
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
PR-URL: #19035
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
@targos targos mentioned this pull request Mar 20, 2018
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
PR-URL: nodejs#19035
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
@jasnell
Copy link
Member

jasnell commented Aug 17, 2018

should this be backported to 8.x? If so, a separate backport PR is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. url Issues and PRs related to the legacy built-in url module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.