File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,7 +83,10 @@ function debug(namespace) {
8383 if ( null == self . useColors ) self . useColors = exports . useColors ( ) ;
8484 if ( null == self . color && self . useColors ) self . color = selectColor ( ) ;
8585
86- var args = Array . prototype . slice . call ( arguments ) ;
86+ var args = new Array ( arguments . length ) ;
87+ for ( var i = 0 ; i < args . length ; i ++ ) {
88+ args [ i ] = arguments [ i ] ;
89+ }
8790
8891 args [ 0 ] = exports . coerce ( args [ 0 ] ) ;
8992
@@ -110,9 +113,9 @@ function debug(namespace) {
110113 return match ;
111114 } ) ;
112115
113- if ( 'function' === typeof exports . formatArgs ) {
114- args = exports . formatArgs . apply ( self , args ) ;
115- }
116+ // apply env-specific formatting
117+ args = exports . formatArgs . apply ( self , args ) ;
118+
116119 var logFn = enabled . log || exports . log || console . log . bind ( console ) ;
117120 logFn . apply ( self , args ) ;
118121 }
Original file line number Diff line number Diff line change @@ -80,12 +80,12 @@ exports.formatters.o = exports.formatters.O = function(v) {
8080 */
8181
8282function formatArgs ( ) {
83- var args = [ ] ;
8483 var len = arguments . length ;
84+ var args = new Array ( len ) ;
8585 var useColors = this . useColors ;
8686 var name = this . namespace ;
8787 for ( var i = 0 ; i < len ; i ++ ) {
88- args . push ( arguments [ i ] ) ;
88+ args [ i ] = arguments [ i ] ;
8989 }
9090
9191 if ( useColors ) {
You can’t perform that action at this time.
0 commit comments