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.
| } else { | ||
| // Proxy TLSSocket handle methods | ||
| function makeSocketMethodProxy(name) { | ||
| return function socketMethodProxy(...args) { |
There was a problem hiding this comment.
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.
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.
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)? |
|
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