-
Notifications
You must be signed in to change notification settings - Fork 623
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
fix(node/fs): Enable test-fs-read-zero-length.js
and test-fs-read-type.js
#2692
Merged
Conversation
This file contains 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
wafuwafu13
commented
Sep 23, 2022
wafuwafu13
commented
Sep 23, 2022
[memo] ./node/_fs/_fs_read_test.ts (uncaught error)
error: TypeError: The "position" argument must be of type bigint or integer. Received null
throw new ERR_INVALID_ARG_TYPE("position", ["integer", "bigint"], position);
^
at __node_internal_ (file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_util.ts:23:11)
at read (file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_read.ts:98:3)
at file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_read_test.ts:33:7
at file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_open.ts:83:17
This error was not caught from a test and caused the test runner to fail on the referenced module.
It most likely originated from a dangling promise, event/timeout handler or top-level code.
./node/_fs/_fs_streams_test.ts (uncaught error)
error: TypeError: The "position" argument must be of type bigint or integer. Received null
throw new ERR_INVALID_ARG_TYPE("position", ["integer", "bigint"], position);
^
at __node_internal_ (file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_util.ts:23:11)
at Object.read (file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_read.ts:98:3)
at <computed> (file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_streams.ts:254:8)
at new Promise (<anonymous>)
at ReadStream._read (file:///home/runner/work/deno_std/deno_std/node/_fs/_fs_streams.ts:252:9)
at ReadStream.w.read (file:///home/runner/work/deno_std/deno_std/node/_stream.mjs:10:34273)
at Ql (file:///home/runner/work/deno_std/deno_std/node/_stream.mjs:10:35586)
at processTicksAndRejections (file:///home/runner/work/deno_std/deno_std/node/_next_tick.ts:41:15)
This error was not caught from a test and caused the test runner to fail on the referenced module.
It most likely originated from a dangling promise, event/timeout handler or top-level code.
FAILURES
./node/_fs/_fs_read_test.ts (uncaught error)
./node/_fs/_fs_streams_test.ts (uncaught error) |
cjihrig
reviewed
Sep 23, 2022
node/_fs/_fs_read.ts
Outdated
@@ -66,11 +64,12 @@ export function read( | |||
cb = optOrBufferOrCb; | |||
} else { | |||
offset = offsetOrCallback as number; | |||
if (Number.isNaN(offset)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this check be:
validateInteger(offset, 'offset', 0);
wafuwafu13
requested review from
cjihrig
and removed request for
kt3k and
bartlomieju
September 25, 2022 09:17
cjihrig
approved these changes
Sep 25, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
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.
part of: #911