src: accept single argument in getProxyDetails#30858
src: accept single argument in getProxyDetails#30858BridgeAR wants to merge 3 commits intonodejs:masterfrom
Conversation
This makes sure this function stays backwards compatible in case it's accessed through the binding directly. Refs: nodejs#29947 (comment)
|
CITGM to confirm that this fixes the issue found there: https://ci.nodejs.org/view/All/job/citgm-smoker/2116/ |
|
If CI is green and CITGM is what we would expect, I would be inclined to fast-track. Collaborators, 👍here to approve fast-tracking, or leave a comment to stop it. |
src/node_util.cc
Outdated
| Local<Proxy> proxy = args[0].As<Proxy>(); | ||
|
|
||
| if (args[1]->IsTrue()) { | ||
| // The length check keeps this function backwards compatible. |
There was a problem hiding this comment.
I think it would be good to name-and-shame here, otherwise the comment is going to befuddle future maintainers. Things at the binding layer don't normally have to worry about backwards compatibility.
There was a problem hiding this comment.
I changed it to a TODO statement. PTAL.
src/node_util.cc
Outdated
|
|
||
| if (args[1]->IsTrue()) { | ||
| // TODO(BridgeAR): Remove the length check as soon as we prohibit access to | ||
| // the util binding layer. It's accessed in the wild and some code would break |
There was a problem hiding this comment.
I'd be more explicit than "some code". We know of esm. Are there other packages (that are popular)?
| // TODO(BridgeAR): Remove the length check as soon as we prohibit access to | ||
| // the util binding layer. It's accessed in the wild and `esm` would break in | ||
| // case the check is removed. | ||
| if (args.Length() == 1 || args[1]->IsTrue()) { |
There was a problem hiding this comment.
The length check here doesn’t change behaviour and could safely be dropped, so you can apply the TODO comment right now if you want.
There was a problem hiding this comment.
You mean if I write if (!args[1]->IsFalse()) { ...old behavior... } else { ...new behavior... }?
There was a problem hiding this comment.
Yes, something like that … feel free to ignore though :)
| if (args[1]->IsTrue()) { | ||
| // TODO(BridgeAR): Remove the length check as soon as we prohibit access to | ||
| // the util binding layer. It's accessed in the wild and `esm` would break in | ||
| // case the check is removed. |
There was a problem hiding this comment.
Is there an issue opened in esm? (BTW it is somewhat ambiguous what esm means here..unless it's explicitly pointed out that this is about the npm package)
This makes sure this function stays backwards compatible in case it's accessed through the binding directly. Refs: #29947 (comment) PR-URL: #30858 Refs: #30767 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
|
Landed in fb14ed4 |
This makes sure this function stays backwards compatible in case it's accessed through the binding directly. Refs: #29947 (comment) PR-URL: #30858 Refs: #30767 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
|
Depends on #30767 to land on v12.x-staging |
This makes sure this function stays backwards compatible in case it's accessed through the binding directly. Refs: nodejs#29947 (comment) PR-URL: nodejs#30858 Refs: nodejs#30767 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This makes sure this function stays backwards compatible in case it's accessed through the binding directly. Refs: #29947 (comment) Backport-PR-URL: #31431 PR-URL: #30858 Refs: #30767 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This makes sure this function stays backwards compatible in case it's accessed through the binding directly. Refs: #29947 (comment) Backport-PR-URL: #31431 PR-URL: #30858 Refs: #30767 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This makes sure this function stays backwards compatible in case
it's accessed through the binding directly.
Refs: #29947 (comment)
Refs: #30767
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes