Uh oh!
There was an error while loading. Please reload this page.
[v12.x] backport #27224 as semver-patch - #27483
Conversation
This caches the current working directory and only updates the variable if `process.chdir()` is called. PR-URL: nodejs#27224 Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This makes sure nodejs#27224 is possible to being backported in a semver-patch way.
nodejs-github-bot
commented
Apr 29, 2019
nodejs-github-bot
commented
Apr 30, 2019
| const originalCwd = process.cwd; | ||
| process.cwd = function() { | ||
| cachedCwd = originalCwd(); |
There was a problem hiding this comment.
I don't think we have a proper convention around this, but I'd add a comment explaining this is only for v12.x to reduce conflicts - this is where the difference between the two branches lie so it'll create conflicts when future commits touch here anyway.
There was a problem hiding this comment.
I struggle finding brief words describing this. I could just add // Backwards compatibility patch: removed code to prevent breaking change..
I personally do not think it would be bad without the comment, since we just work on master and people backporting code should see the compatibility commit.
| } | ||
| function cwd() { | ||
| cachedCwd = binding.cwd(); |
There was a problem hiding this comment.
Similarly I'd add a comment here.
targos
commented
May 5, 2019
This caches the current working directory and only updates the variable if `process.chdir()` is called. PR-URL: #27224 Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Backport-PR-URL: #27483
This makes sure #27224 is possible to being backported in a semver-patch way. PR-URL: #27483 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com>
The actual breaking changes in #27224 have been reverted here in a way that most code was possible to being backported.
This is necessary to reduce conflicts in our release lines. #27224 was the first semver-major to land after the v12 cut-off and thus it should also be the first to be backported. This is a trial run since without such backports it becomes increasingly difficult to put together releases after a while.
// cc @nodejs/releasers
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes