-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
tls: de-duplicate for TLSSocket methods #22142
Conversation
This comment has been minimized.
This comment has been minimized.
Similar approach is used for `TLSWrap`, where C++ handle methods are mapped one-to-one in JS.
db3de03
to
a0ded1e
Compare
} else { | ||
// Proxy TLSSocket handle methods | ||
function makeSocketMethodProxy(name) { | ||
return function socketMethodProxy(...args) { |
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.
Won't this show up in stack traces now instead of the actual proxied function name? I think having the actual function name in the stack trace would be more helpful.
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.
V8 is able to infer the method names. This should show up as TLSSocket.socketMethodProxy <as getFinished>
(previously TLSSocket.getFinished
)
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.
Yep, like @joyeecheung is saying, if an error was thrown in getFinished
it would now appear as at TLSSocket.socketMethodProxy [as getFinished]
@nodejs/security-wg |
By the way this does alter the return values of certain methods from |
|
Will label semver-major just out of caution, in the unlikely chance someone's doing a |
@mscdex Is your comment a blocking -1 (can you use the "request changes" review option if so)? |
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.
LGTM
ping @mscdex |
Landed in 3c2aa4b |
Similar approach is used for `TLSWrap`, where C++ handle methods are mapped one-to-one in JS. PR-URL: #22142 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Similar approach is used for
TLSWrap
, where C++ handle methods aremapped one-to-one in JS.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes