File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 1414 var noop = function ( ) {
1515 } ;
1616
17+ var logError ;
18+ if ( typeof console !== strUndef ) {
19+ logError = function ( err ) {
20+ console . error ( err ) ;
21+ }
22+ } else {
23+ logError = noop ;
24+ }
25+
1726 var hasClass , addClass , removeClass ;
1827 if ( document . body . classList ) {
1928 hasClass = function ( el , className ) {
572581 var relativePath = dirPath + file . name ;
573582 files . push ( { file : file , relativePath : relativePath } ) ;
574583 } ) [ 'catch' ] ( function ( err ) { // workaround IE8- syntax error for ".catch"(reserved keyword)
575- typeof console !== strUndef && console . error ( err ) ;
584+ logError ( err ) ;
576585 } ) ;
577586 } else if ( handle . kind === handleKindDir ) {
578587 return new Promise ( function ( resolve ) {
652661 increaseCb ( ) ;
653662 } , function ( err ) {
654663 increaseCb ( ) ;
655- typeof console !== strUndef && console . error ( err ) ;
664+ logError ( err ) ;
656665 } ) ;
657666 } else if ( entry . isDirectory ) {
658667 var reader = entry . createReader ( ) ;
12151224 var elItemParent = elItem . parentNode ;
12161225 elItemParent && elItemParent . removeChild ( elItem ) ;
12171226 } else {
1218- typeof console != strUndef && console . error ( 'delete failed' , status , this . statusText )
1227+ logError ( 'delete failed: ' + status + ' ' + this . statusText ) ;
12191228 }
12201229 }
12211230
You can’t perform that action at this time.
0 commit comments