Skip to content

Conversation

@targos
Copy link
Member

@targos targos commented Feb 27, 2018

This is a first batch of updates that touches non-underscored modules in /lib/.

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

all subsystems :)

/cc @joyeecheung @BridgeAR @jasnell

@targos targos added semver-major PRs that contain breaking changes and should be released in the next major version. lib / src Issues and PRs related to general changes in the lib or src directory. errors Issues and PRs related to JavaScript errors originated in Node.js core. labels Feb 27, 2018
@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Feb 27, 2018
Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

The changes itself LG by briefly scanning over it but I personally would remove the BC.

Copy link
Member

Choose a reason for hiding this comment

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

Is this not failing? I expected that the invalidArgTypeError call number has to be changed otherwise?

Copy link
Member Author

Choose a reason for hiding this comment

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

Possible. It was failing because I forgot to update it, but then I forgot to run it again

Copy link
Member

Choose a reason for hiding this comment

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

Without changing the errors that result in such changes, the PR would be a patch. I personally prefer a PR that is possible to backport instead of having the PR as semver-major because just very few cases that were wrong before.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can remove the semver-major changes, but I think a backport would have to be done from scratch anyway, even for v9.x, because many error codes don't exist in any release line

Copy link
Member

Choose a reason for hiding this comment

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

Most errors were already ported in 9.x as far as I know. I personally still think it would be better to have this as a semver-patch but I am fine with it if others want to land it as is.

lib/module.js Outdated
Copy link
Member

Choose a reason for hiding this comment

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

To me it seems like this is a TypeError, not a RangeError. Don't you think so?

Copy link
Member Author

Choose a reason for hiding this comment

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

The type is checked just before. I don't feel strongly about it but it seemed right to throw a RangeError: the must be greater than zero

Copy link
Member

Choose a reason for hiding this comment

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

Well, I guess it is somewhat of a edge case. I do not feel strongly about it either.

Copy link
Member

Choose a reason for hiding this comment

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

I think usually we just go with ERR_OUT_OF_RANGE for this sort of generic range errors..probably makes more sense if it's ERR_INVALID_ARG_VALUE.Error on id, or a ERR_OUT_OF_RANGE on id.length

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed it to a TypeError. @joyeecheung are you OK with that?

Copy link
Member

Choose a reason for hiding this comment

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

Most errors were already ported in 9.x as far as I know. I personally still think it would be better to have this as a semver-patch but I am fine with it if others want to land it as is.

Copy link
Member

@BridgeAR BridgeAR 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 needs a rebase

@targos
Copy link
Member Author

targos commented Mar 2, 2018

@targos
Copy link
Member Author

targos commented Mar 4, 2018

Rebased again. Hopefully last CI: https://ci.nodejs.org/job/node-test-pull-request/13484/

@BridgeAR
Copy link
Member

BridgeAR commented Mar 4, 2018

As a question: shall we squash this or land each on it's own? I am fine both ways, I just thought I ask because it is a lot of commits.

@targos
Copy link
Member Author

targos commented Mar 4, 2018

I'm for squashing

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

targos commented Mar 5, 2018

And another CI: https://ci.nodejs.org/job/node-test-pull-request/13509/

There is no single green result but no failure seem related or reproducible so I'm going to land this.

targos added a commit that referenced this pull request Mar 5, 2018
This is a first batch of updates that touches non-underscored modules in
lib.

PR-URL: #19034
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@targos
Copy link
Member Author

targos commented Mar 5, 2018

Squashed and landed in 1e8d110

@targos targos closed this Mar 5, 2018
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
This is a first batch of updates that touches non-underscored modules in
lib.

PR-URL: nodejs#19034
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@targos targos deleted the port-errors branch October 17, 2020 12:53
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. errors Issues and PRs related to JavaScript errors originated in Node.js core. lib / src Issues and PRs related to general changes in the lib or src directory. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants