fs: fix readFile will pass undefined to callback but not null#3740
fs: fix readFile will pass undefined to callback but not null#3740zbinlin wants to merge 1 commit intonodejs:masterfrom
Conversation
|
I suppose this doesn't hurt for a little extra consistency. LGTM |
|
Care to change the |
|
In my node's package promise-adapter, I am not sure a callback whether is node-style or not,so I suppose if the first arguments is null that is node-style callback. Other cases, I think this has little effect. |
|
I'm not sure how reliable that will be. I'd be willing to bet that there are cases where the first arg to the callback is undefined. |
|
LGTM |
1 similar comment
|
LGTM |
This commit ensures that readFile() callsback with a null error consistently on success. PR-URL: #3740 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
|
Thanks! Landed in 1594198 |
|
@jasnell sorry, which labels should I apply to have this backported? There are too many labels to pick from :-) |
|
Please use the |
This commit ensures that readFile() callsback with a null error consistently on success. PR-URL: #3740 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
|
removing this from lts-watch as it effects code that was part of a semver-major fix that will not be applied to v4.x @cjihrig please feel free to reapply to tag if I am mistaken |
|
agreeing with @thealphanerd on this and applying |
In PR-3485, if encoding set, fs.readFile will pass undefined not null to callback.