Commit 9359de9d authored by Sakthipriyan Vairamani's avatar Sakthipriyan Vairamani
Browse files

fs: make callback mandatory to all async functions

The "fs" module has two functions called `maybeCallback` and
`makeCallback`, as of now.

The `maybeCallback` creates a default function to report errors, if the
parameter passed is not a function object. Basically, if the callback
is omitted in some cases, this function is used to create a default
callback function.

The `makeCallback`, OTOH, creates a default function only if the
parameter passed is `undefined`, and if it is not a function object it
will throw an `Error`.

This patch removes the `maybeCallback` function and makes the callback
function argument mandatory for all the async functions.

PR-URL: https://github.com/nodejs/node/pull/7168


Reviewed-By: default avatarTrevor Norris <trev.norris@gmail.com>
parent 9983af03
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment