Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs: fix readFile will pass undefined to callback but not null #3740

Closed
wants to merge 1 commit into from

Conversation

zbinlin
Copy link
Contributor

@zbinlin zbinlin commented Nov 10, 2015

In PR-3485, if encoding set, fs.readFile will pass undefined not null to callback.

@cjihrig
Copy link
Contributor

cjihrig commented Nov 10, 2015

I suppose this doesn't hurt for a little extra consistency. LGTM

@cjihrig
Copy link
Contributor

cjihrig commented Nov 10, 2015

Care to change the var to let?

@mscdex mscdex added the fs Issues and PRs related to the fs subsystem / file system. label Nov 10, 2015
@zbinlin
Copy link
Contributor Author

zbinlin commented Nov 10, 2015

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.

@evanlucas
Copy link
Contributor

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.

@evanlucas
Copy link
Contributor

@thefourtheye
Copy link
Contributor

LGTM

1 similar comment
@JungMinu
Copy link
Member

LGTM

@cjihrig
Copy link
Contributor

cjihrig commented Nov 11, 2015

cjihrig pushed a commit that referenced this pull request Nov 11, 2015
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>
@cjihrig
Copy link
Contributor

cjihrig commented Nov 11, 2015

Thanks! Landed in 1594198

@cjihrig cjihrig closed this Nov 11, 2015
@cjihrig
Copy link
Contributor

cjihrig commented Nov 11, 2015

@jasnell sorry, which labels should I apply to have this backported? There are too many labels to pick from :-)

@jasnell
Copy link
Member

jasnell commented Nov 11, 2015

Please use the lts-watch labels to identify things that should be back ported.

@zbinlin zbinlin deleted the fix-bug-branch branch November 12, 2015 04:37
rvagg pushed a commit that referenced this pull request Nov 13, 2015
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>
@MylesBorins
Copy link
Contributor

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

@rvagg
Copy link
Member

rvagg commented Jan 15, 2016

agreeing with @thealphanerd on this and applying dont-land-on-v4.x, looks like prior to #3485 it was returning null already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants