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

errors, url: migrate to use internal/errors.js #11360

Closed
wants to merge 5 commits into from

Conversation

bougarfaoui
Copy link

Migrate url.js to use internal/errors.js

Refs: #11273

cc @jasnell .

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)

errors, url

@nodejs-github-bot nodejs-github-bot added errors Issues and PRs related to JavaScript errors originated in Node.js core. url Issues and PRs related to the legacy built-in url module. labels Feb 13, 2017
lib/url.js Outdated
@@ -92,7 +93,7 @@ function urlParse(url, parseQueryString, slashesDenoteHost) {

Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
if (typeof url !== 'string') {
throw new TypeError('Parameter "url" must be a string, not ' + typeof url);
throw new errors.TypeError('ERR_INVALID_ARG_TYPE','url','String',url);
Copy link
Member

Choose a reason for hiding this comment

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

Linter should complain here, there needs to be a space following the comma. Can you run make lint to check this?

lib/url.js Outdated
@@ -546,8 +547,7 @@ function urlFormat(obj, options) {
if (typeof obj === 'string') {
obj = urlParse(obj);
} else if (typeof obj !== 'object' || obj === null) {
throw new TypeError('Parameter "urlObj" must be an object, not ' +
(obj === null ? 'null' : typeof obj));
throw new errors.TypeError('ERR_INVALID_ARG_TYPE','obj','Object',obj);
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

@jasnell jasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Feb 14, 2017
@jasnell jasnell added the blocked PRs that are blocked by other issues or PRs. label Apr 5, 2017
@fhinkel
Copy link
Member

fhinkel commented May 23, 2017

@bougarfaoui Thanks so much for putting this together. Sorry that it is dragging out for so long due to being a semver-major change. Could you rebase and also squash your commits (I think all the changes should be one commit, right?). Thanks!

Copy link
Member

@fhinkel fhinkel left a comment

Choose a reason for hiding this comment

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

Are there any tests that cover these changes?

@fhinkel fhinkel added the stalled Issues and PRs that are stalled. label Jun 7, 2017
@fhinkel
Copy link
Member

fhinkel commented Jun 28, 2017

I'm closing this because it's been inactive for quite a while. Feel free to reopen or ping a collaborator to get it reopened if needed.

@refack
Copy link
Contributor

refack commented Jul 19, 2017

I'll follow up

@refack refack reopened this Jul 19, 2017
@refack refack removed blocked PRs that are blocked by other issues or PRs. stalled Issues and PRs that are stalled. labels Jul 19, 2017
@refack refack self-assigned this Jul 19, 2017
@starkwang
Copy link
Contributor

starkwang commented Aug 8, 2017

The errors in url module have been migrated in #13963.
So I think this PR should be closed.

@refack
Copy link
Contributor

refack commented Aug 8, 2017

Done

@refack refack closed this Aug 8, 2017
@refack refack removed their assignment Oct 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
errors Issues and PRs related to JavaScript errors originated in Node.js core. semver-major PRs that contain breaking changes and should be released in the next major version. 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.

7 participants