@@ -244,7 +244,7 @@ function fetchXHR(fetch, onsuccess, onerror, onprogress, onreadystatechange) {
244
244
#if FETCH_DEBUG
245
245
dbg ( 'fetch: XHR failed, no URL specified!' ) ;
246
246
#endif
247
- onerror ( fetch , 0 , 'no url specified!' ) ;
247
+ onerror ( fetch , 'no url specified!' ) ;
248
248
return ;
249
249
}
250
250
var url_ = UTF8ToString ( url ) ;
@@ -363,12 +363,12 @@ function fetchXHR(fetch, onsuccess, onerror, onprogress, onreadystatechange) {
363
363
#if FETCH_DEBUG
364
364
dbg ( `fetch: xhr of URL "${ xhr . url_ } " / responseURL "${ xhr . responseURL } " succeeded with status ${ xhr . status } ` ) ;
365
365
#endif
366
- onsuccess ?. ( fetch , xhr , e ) ;
366
+ onsuccess ( fetch , xhr , e ) ;
367
367
} else {
368
368
#if FETCH_DEBUG
369
369
dbg ( `fetch: xhr of URL "${ xhr . url_ } " / responseURL "${ xhr . responseURL } " failed with status ${ xhr . status } ` ) ;
370
370
#endif
371
- onerror ?. ( fetch , xhr , e ) ;
371
+ onerror ( fetch , e ) ;
372
372
}
373
373
} ;
374
374
xhr . onerror = ( e ) => {
@@ -380,7 +380,7 @@ function fetchXHR(fetch, onsuccess, onerror, onprogress, onreadystatechange) {
380
380
dbg ( `fetch: xhr of URL "${ xhr . url_ } " / responseURL "${ xhr . responseURL } " finished with error, readyState ${ xhr . readyState } and status ${ xhr . status } ` ) ;
381
381
#endif
382
382
saveResponseAndStatus ( ) ;
383
- onerror ?. ( fetch , xhr , e ) ;
383
+ onerror ( fetch , e ) ;
384
384
} ;
385
385
xhr . ontimeout = ( e ) => {
386
386
// check if xhr was aborted by user and don't try to call back
@@ -390,7 +390,7 @@ function fetchXHR(fetch, onsuccess, onerror, onprogress, onreadystatechange) {
390
390
#if FETCH_DEBUG
391
391
dbg ( `fetch: xhr of URL "${ xhr . url_ } " / responseURL "${ xhr . responseURL } " timed out, readyState ${ xhr . readyState } and status ${ xhr . status } ` ) ;
392
392
#endif
393
- onerror ?. ( fetch , xhr , e ) ;
393
+ onerror ( fetch , e ) ;
394
394
} ;
395
395
xhr . onprogress = ( e ) => {
396
396
// check if xhr was aborted by user and don't try to call back
@@ -420,7 +420,7 @@ function fetchXHR(fetch, onsuccess, onerror, onprogress, onreadystatechange) {
420
420
if ( xhr . readyState >= 3 && xhr . status === 0 && e . loaded > 0 ) status = 200 ;
421
421
{ { { makeSetValue ( 'fetch' , C_STRUCTS . emscripten_fetch_t . status , 'status' , 'i16' ) } } }
422
422
if ( xhr . statusText ) stringToUTF8 ( xhr . statusText , fetch + { { { C_STRUCTS . emscripten_fetch_t . statusText } } } , 64 ) ;
423
- onprogress ?. ( fetch , xhr , e ) ;
423
+ onprogress ( fetch , e ) ;
424
424
_free ( ptr ) ;
425
425
} ;
426
426
xhr . onreadystatechange = ( e ) => {
@@ -439,7 +439,7 @@ function fetchXHR(fetch, onsuccess, onerror, onprogress, onreadystatechange) {
439
439
var ruPtr = stringToNewUTF8 ( xhr . responseURL ) ;
440
440
{ { { makeSetValue ( 'fetch' , C_STRUCTS . emscripten_fetch_t . responseUrl , 'ruPtr' , '*' ) } } }
441
441
}
442
- onreadystatechange ?. ( fetch , xhr , e ) ;
442
+ onreadystatechange ( fetch , e ) ;
443
443
} ;
444
444
#if FETCH_DEBUG
445
445
dbg ( `fetch: xhr.send(data=${ data } )` ) ;
@@ -450,7 +450,7 @@ function fetchXHR(fetch, onsuccess, onerror, onprogress, onreadystatechange) {
450
450
#if FETCH_DEBUG
451
451
dbg ( `fetch: xhr failed with exception: ${ e } ` ) ;
452
452
#endif
453
- onerror ?. ( fetch , xhr , e ) ;
453
+ onerror ( fetch , e ) ;
454
454
}
455
455
}
456
456
@@ -486,14 +486,14 @@ function startFetch(fetch, successcb, errorcb, progresscb, readystatechangecb) {
486
486
} ) ;
487
487
} ;
488
488
489
- var reportProgress = ( fetch , xhr , e ) => {
489
+ var reportProgress = ( fetch , e ) => {
490
490
doCallback ( ( ) => {
491
491
if ( onprogress ) { { { makeDynCall ( 'vp' , 'onprogress' ) } } } ( fetch ) ;
492
492
else progresscb ?. ( fetch ) ;
493
493
} ) ;
494
494
} ;
495
495
496
- var reportError = ( fetch , xhr , e ) => {
496
+ var reportError = ( fetch , e ) => {
497
497
#if FETCH_DEBUG
498
498
dbg ( `fetch: operation failed: ${ e } ` ) ;
499
499
#endif
@@ -504,7 +504,7 @@ function startFetch(fetch, successcb, errorcb, progresscb, readystatechangecb) {
504
504
} ) ;
505
505
} ;
506
506
507
- var reportReadyStateChange = ( fetch , xhr , e ) => {
507
+ var reportReadyStateChange = ( fetch , e ) => {
508
508
#if FETCH_DEBUG
509
509
dbg ( `fetch: ready state change. e: ${ e } ` ) ;
510
510
#endif
0 commit comments