mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
tls: avoid using forEach
PR-URL: https://github.com/nodejs/node/pull/11582 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
1 parent
910a8998fb
commit
5aa7d4daca
1 file changed
+7
-3
+7
-3
@@ -321,12 +321,16 @@ var proxiedMethods = [
|
||||
];
|
||||
|
||||
// Proxy HandleWrap, PipeWrap and TCPWrap methods
|
||||
proxiedMethods.forEach(function(name) {
|
||||
tls_wrap.TLSWrap.prototype[name] = function methodProxy(...args) {
|
||||
function makeMethodProxy(name) {
|
||||
return function methodProxy(...args) {
|
||||
if (this._parent[name])
|
||||
return this._parent[name].apply(this._parent, args);
|
||||
};
|
||||
});
|
||||
}
|
||||
for (var n = 0; n < proxiedMethods.length; n++) {
|
||||
tls_wrap.TLSWrap.prototype[proxiedMethods[n]] =
|
||||
makeMethodProxy(proxiedMethods[n]);
|
||||
}
|
||||
|
||||
tls_wrap.TLSWrap.prototype.close = function close(cb) {
|
||||
let ssl;
|
||||
|
||||
Reference in new issue
Block a user