-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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
src: accept single argument in getProxyDetails #30858
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,11 +91,10 @@ static void GetProxyDetails(const FunctionCallbackInfo<Value>& args) { | |
if (!args[0]->IsProxy()) | ||
return; | ||
|
||
CHECK(args[1]->IsBoolean()); | ||
|
||
Local<Proxy> proxy = args[0].As<Proxy>(); | ||
|
||
if (args[1]->IsTrue()) { | ||
// The length check keeps this function backwards compatible. | ||
if (args.Length() == 1 || args[1]->IsTrue()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The length check here doesn’t change behaviour and could safely be dropped, so you can apply the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean if I write There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, something like that … feel free to ignore though :) |
||
Local<Value> ret[] = { | ||
proxy->GetTarget(), | ||
proxy->GetHandler() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to a TODO statement. PTAL.