Skip to content

Node 10.0.0 fs.close is called with a second undefined argument. #20335

@mattcollier

Description

@mattcollier
  • Version: 10.0.0
  • Platform: Debian 9
  • Subsystem:

The documentation for fs.close states "No arguments other than a possible exception are given to the completion callback."

When used in conjunction with API's like async.waterfall, it is important that the callback is called with exactly one argument (err) because additional arguments are passed on to the next task.

I have found that in node 10.0.0 fs.close is invoking the callback with two arguments (err, undefined) here: https://github.com/nodejs/node/blob/v10.x/lib/fs.js#L506

I initially thought the issue might be due to recent changes in the makeCallback function, but that is not the case. The oncomplete handler is being called with a second undefined argument.

I see that there have been many changes to FSReqWrap in native land. Maybe the issue is in there somewhere?

I made this JS patch as a workaround: v10.x...digitalbazaar:v10.x

tracking: digitalbazaar/bedrock#25

Metadata

Metadata

Assignees

Labels

fsIssues and PRs related to the fs subsystem / file system.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions