Skip to content

Conversation

@ah-yu
Copy link
Contributor

@ah-yu ah-yu commented Apr 10, 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

@nodejs-github-bot nodejs-github-bot added the fs Issues and PRs related to the fs subsystem / file system. label Apr 10, 2018
@ah-yu
Copy link
Contributor Author

ah-yu commented Apr 10, 2018

@BridgeAR

@mscdex
Copy link
Contributor

mscdex commented Apr 10, 2018

The prefix for the first commit should just be fs: instead of feat(internal/fs):.

@ah-yu ah-yu force-pushed the internal-fs-validate branch from e2469ad to 0ba1b37 Compare April 10, 2018 09:10
@ah-yu
Copy link
Contributor Author

ah-yu commented Apr 10, 2018

fixed it, thanks for your suggestion! @mscdex

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.

It would be nice to also add a test for floating point numbers.

err = new ERR_INVALID_ARG_TYPE('len', 'number', len);
} else {
} else if (!Number.isInteger(len)) {
// TODO(BridgeAR): Improve this error message.
Copy link
Member

Choose a reason for hiding this comment

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

You can actually remove my comment now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok


if (!isInt32(len)) {
if (typeof value !== 'number') {
if (typeof len !== 'number') {
Copy link
Member

Choose a reason for hiding this comment

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

❤️

@BridgeAR
Copy link
Member

@ah-yu
Copy link
Contributor Author

ah-yu commented Apr 11, 2018

Fixed the comments. @BridgeAR

});

[-1.5, 1.5].forEach((input) => {
assert.throws(
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to use common.expectsError in our tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. thanks for review :)

Copy link
Member

Choose a reason for hiding this comment

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

@starkwang I must disagree. The original reason for using common.expectsError is that it allowed to use the error object. Now, assert.throws is more powerful than common.expectsError due to a much better error message output and since that feature was added to assert.throws.

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 12, 2018
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Apr 13, 2018
PR-URL: nodejs#19909
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@BridgeAR
Copy link
Member

Landed in 61e232b 🎉

I removed the common.expectsError change while landing.

@BridgeAR BridgeAR closed this Apr 13, 2018
jasnell pushed a commit that referenced this pull request Apr 16, 2018
PR-URL: #19909
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
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. fs Issues and PRs related to the fs subsystem / file system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants