File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -252,6 +252,20 @@ function promisify(orig) {
252252
253253promisify . custom = kCustomPromisifiedSymbol ;
254254
255+ // The build-in Array#join is slower in v8 6.0
256+ function join ( output , separator ) {
257+ var str = '' ;
258+ if ( output . length !== 0 ) {
259+ for ( var i = 0 ; i < output . length - 1 ; i ++ ) {
260+ // It is faster not to use a template string here
261+ str += output [ i ] ;
262+ str += separator ;
263+ }
264+ str += output [ i ] ;
265+ }
266+ return str ;
267+ }
268+
255269module . exports = {
256270 assertCrypto,
257271 cachedResult,
@@ -265,6 +279,7 @@ module.exports = {
265279 normalizeEncoding,
266280 objectToString,
267281 promisify,
282+ join,
268283
269284 // Symbol used to customize promisify conversion
270285 customPromisifyArgs : kCustomPromisifyArgsSymbol ,
You can’t perform that action at this time.
0 commit comments