File tree 4 files changed +3
-29
lines changed
4 files changed +3
-29
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ function main({ n }) {
12
12
var m = { } ;
13
13
// First call dominates results
14
14
if ( n > 1 ) {
15
- tls . convertNPNProtocols ( input , m ) ;
15
+ tls . convertALPNProtocols ( input , m ) ;
16
16
m = { } ;
17
17
}
18
18
bench . start ( ) ;
19
19
for ( var i = 0 ; i < n ; i ++ )
20
- tls . convertNPNProtocols ( input , m ) ;
20
+ tls . convertALPNProtocols ( input , m ) ;
21
21
bench . end ( n ) ;
22
22
}
Original file line number Diff line number Diff line change @@ -977,7 +977,7 @@ objects respectively.
977
977
<a id="DEP0107"></a>
978
978
### DEP0107: tls.convertNPNProtocols()
979
979
980
- Type: Runtime
980
+ Type: End-of-Life
981
981
982
982
This was an undocumented helper function not intended for use outside Node.js
983
983
core and obsoleted by the removal of NPN (Next Protocol Negotiation) support.
Original file line number Diff line number Diff line change @@ -76,16 +76,6 @@ function convertProtocols(protocols) {
76
76
return buff ;
77
77
}
78
78
79
- exports . convertNPNProtocols = internalUtil . deprecate ( function ( protocols , out ) {
80
- // If protocols is Array - translate it into buffer
81
- if ( Array . isArray ( protocols ) ) {
82
- out . NPNProtocols = convertProtocols ( protocols ) ;
83
- } else if ( isUint8Array ( protocols ) ) {
84
- // Copy new buffer not to be modified by user.
85
- out . NPNProtocols = Buffer . from ( protocols ) ;
86
- }
87
- } , 'tls.convertNPNProtocols() is deprecated.' , 'DEP0107' ) ;
88
-
89
79
exports . convertALPNProtocols = function ( protocols , out ) {
90
80
// If protocols is Array - translate it into buffer
91
81
if ( Array . isArray ( protocols ) ) {
Original file line number Diff line number Diff line change @@ -93,25 +93,9 @@ common.expectsError(
93
93
assert ( out . ALPNProtocols . equals ( Buffer . from ( 'efgh' ) ) ) ;
94
94
}
95
95
96
- {
97
- const buffer = Buffer . from ( 'abcd' ) ;
98
- const out = { } ;
99
- tls . convertNPNProtocols ( buffer , out ) ;
100
- out . NPNProtocols . write ( 'efgh' ) ;
101
- assert ( buffer . equals ( Buffer . from ( 'abcd' ) ) ) ;
102
- assert ( out . NPNProtocols . equals ( Buffer . from ( 'efgh' ) ) ) ;
103
- }
104
-
105
96
{
106
97
const buffer = new Uint8Array ( Buffer . from ( 'abcd' ) ) ;
107
98
const out = { } ;
108
99
tls . convertALPNProtocols ( buffer , out ) ;
109
100
assert ( out . ALPNProtocols . equals ( Buffer . from ( 'abcd' ) ) ) ;
110
101
}
111
-
112
- {
113
- const buffer = new Uint8Array ( Buffer . from ( 'abcd' ) ) ;
114
- const out = { } ;
115
- tls . convertNPNProtocols ( buffer , out ) ;
116
- assert ( out . NPNProtocols . equals ( Buffer . from ( 'abcd' ) ) ) ;
117
- }
You can’t perform that action at this time.
0 commit comments