Commit a8043473 authored by Ben Noordhuis's avatar Ben Noordhuis
Browse files

fs: fix 'object is not a function' callback errors

Use a default callback if the user omitted one. Avoids errors like the one
below:

  fs.js:777
      if (err) return callback(err);
                      ^
  TypeError: object is not a function
          at fs.appendFile (fs.js:777:21)
          at Object.oncomplete (fs.js:297:15)

This commit fixes the behavior of fs.lchmod(), fs.lchown() and fs.readFile()
when the callback is omitted. Before, they silently swallowed errors.

Fixes #4352.
parent 03b00dcc
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