Merge pull request #11185 from electron/fs-optional-options
fix: fs.readFile: make options optional
This commit is contained in:
commit
fa37d49fb6
1 changed files with 4 additions and 0 deletions
|
@ -464,6 +464,10 @@
|
|||
options = {
|
||||
encoding: options
|
||||
}
|
||||
} else if (options === null || options === undefined) {
|
||||
options = {
|
||||
encoding: null
|
||||
}
|
||||
} else if (!util.isObject(options)) {
|
||||
throw new TypeError('Bad arguments')
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue