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 14
14
var noop = function ( ) {
15
15
} ;
16
16
17
+ var logError ;
18
+ if ( typeof console !== strUndef ) {
19
+ logError = function ( err ) {
20
+ console . error ( err ) ;
21
+ }
22
+ } else {
23
+ logError = noop ;
24
+ }
25
+
17
26
var hasClass , addClass , removeClass ;
18
27
if ( document . body . classList ) {
19
28
hasClass = function ( el , className ) {
572
581
var relativePath = dirPath + file . name ;
573
582
files . push ( { file : file , relativePath : relativePath } ) ;
574
583
} ) [ 'catch' ] ( function ( err ) { // workaround IE8- syntax error for ".catch"(reserved keyword)
575
- typeof console !== strUndef && console . error ( err ) ;
584
+ logError ( err ) ;
576
585
} ) ;
577
586
} else if ( handle . kind === handleKindDir ) {
578
587
return new Promise ( function ( resolve ) {
652
661
increaseCb ( ) ;
653
662
} , function ( err ) {
654
663
increaseCb ( ) ;
655
- typeof console !== strUndef && console . error ( err ) ;
664
+ logError ( err ) ;
656
665
} ) ;
657
666
} else if ( entry . isDirectory ) {
658
667
var reader = entry . createReader ( ) ;
1215
1224
var elItemParent = elItem . parentNode ;
1216
1225
elItemParent && elItemParent . removeChild ( elItem ) ;
1217
1226
} else {
1218
- typeof console != strUndef && console . error ( 'delete failed' , status , this . statusText )
1227
+ logError ( 'delete failed: ' + status + ' ' + this . statusText ) ;
1219
1228
}
1220
1229
}
1221
1230
You can’t perform that action at this time.
0 commit comments