Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6f5ced6

Browse filesBrowse files
BridgeARMylesBorins
authored andcommitted
src: accept single argument in getProxyDetails
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>
1 parent cc19d08 commit 6f5ced6
Copy full SHA for 6f5ced6

File tree

Expand file treeCollapse file tree

2 files changed

+8
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-3
lines changed
Open diff view settings
Collapse file

‎src/node_util.cc‎

Copy file name to clipboardExpand all lines: src/node_util.cc
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ static void GetProxyDetails(const FunctionCallbackInfo<Value>& args) {
9191
if (!args[0]->IsProxy())
9292
return;
9393

94-
CHECK(args[1]->IsBoolean());
95-
9694
Local<Proxy> proxy = args[0].As<Proxy>();
9795

98-
if (args[1]->IsTrue()) {
96+
// TODO(BridgeAR): Remove the length check as soon as we prohibit access to
97+
// the util binding layer. It's accessed in the wild and `esm` would break in
98+
// case the check is removed.
99+
if (args.Length() == 1 || args[1]->IsTrue()) {
99100
Local<Value> ret[] = {
100101
proxy->GetTarget(),
101102
proxy->GetHandler()
Collapse file

‎test/parallel/test-util-inspect-proxy.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect-proxy.js
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ let details = processUtil.getProxyDetails(proxyObj, true);
5050
assert.strictEqual(target, details[0]);
5151
assert.strictEqual(handler, details[1]);
5252

53+
details = processUtil.getProxyDetails(proxyObj);
54+
assert.strictEqual(target, details[0]);
55+
assert.strictEqual(handler, details[1]);
56+
5357
details = processUtil.getProxyDetails(proxyObj, false);
5458
assert.strictEqual(target, details);
5559

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.