Skip to content

Commit 6f3cfb4

Browse files
committed
cleanup minimal
1 parent 8b189d2 commit 6f3cfb4

File tree

5 files changed

+109
-72
lines changed

5 files changed

+109
-72
lines changed

src/Fetch.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ function fetchXHR(fetch, onsuccess, onerror, onprogress, onreadystatechange) {
434434
function startFetch(fetch, successcb, errorcb, progresscb, readystatechangecb) {
435435
// Avoid shutting down the runtime since we want to wait for the async
436436
// response.
437-
runtimeKeepalivePush();
437+
{{{ runtimeKeepalivePush() }}}
438438

439439
var fetch_attr = fetch + {{{ C_STRUCTS.emscripten_fetch_t.__attributes }}};
440440
var requestMethod = UTF8ToString(fetch_attr);
@@ -456,7 +456,7 @@ function startFetch(fetch, successcb, errorcb, progresscb, readystatechangecb) {
456456
#if FETCH_DEBUG
457457
console.log('fetch: operation success. e: ' + e);
458458
#endif
459-
runtimeKeepalivePop();
459+
{{{ runtimeKeepalivePop() }}}
460460
callUserCallback(function() {
461461
if (onsuccess) {{{ makeDynCall('vi', 'onsuccess') }}}(fetch);
462462
else if (successcb) successcb(fetch);
@@ -474,7 +474,7 @@ function startFetch(fetch, successcb, errorcb, progresscb, readystatechangecb) {
474474
#if FETCH_DEBUG
475475
console.error('fetch: operation failed: ' + e);
476476
#endif
477-
runtimeKeepalivePop();
477+
{{{ runtimeKeepalivePop() }}}
478478
callUserCallback(function() {
479479
if (onerror) {{{ makeDynCall('vi', 'onerror') }}}(fetch);
480480
else if (errorcb) errorcb(fetch);
@@ -507,7 +507,7 @@ function startFetch(fetch, successcb, errorcb, progresscb, readystatechangecb) {
507507
#if FETCH_DEBUG
508508
console.log('fetch: IndexedDB store succeeded.');
509509
#endif
510-
runtimeKeepalivePop();
510+
{{{ runtimeKeepalivePop() }}}
511511
callUserCallback(function() {
512512
if (onsuccess) {{{ makeDynCall('vi', 'onsuccess') }}}(fetch);
513513
else if (successcb) successcb(fetch);
@@ -517,7 +517,7 @@ function startFetch(fetch, successcb, errorcb, progresscb, readystatechangecb) {
517517
#if FETCH_DEBUG
518518
console.error('fetch: IndexedDB store failed.');
519519
#endif
520-
runtimeKeepalivePop();
520+
{{{ runtimeKeepalivePop() }}}
521521
callUserCallback(function() {
522522
if (onsuccess) {{{ makeDynCall('vi', 'onsuccess') }}}(fetch);
523523
else if (successcb) successcb(fetch);

src/library.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3772,9 +3772,11 @@ LibraryManager.library = {
37723772

37733773
// Callable in pthread without __proxy needed.
37743774
emscripten_exit_with_live_runtime__sig: 'v',
3775+
#if !MINIMAL_RUNTIME
37753776
emscripten_exit_with_live_runtime__deps: ['$runtimeKeepalivePush'],
3777+
#endif
37763778
emscripten_exit_with_live_runtime: function() {
3777-
runtimeKeepalivePush();
3779+
{{{ runtimeKeepalivePush() }}}
37783780
throw 'unwind';
37793781
},
37803782

@@ -3832,7 +3834,9 @@ LibraryManager.library = {
38323834
// The job of this wrapper is the handle emscripten-specfic exceptions such
38333835
// as ExitStatus and 'unwind' and prevent these from escaping to the top
38343836
// level.
3837+
#if EXIT_RUNTIME || USE_PTHREADS
38353838
$callUserCallback__deps: ['$maybeExit'],
3839+
#endif
38363840
$callUserCallback: function(func) {
38373841
if (ABORT) {
38383842
#if ASSERTIONS
@@ -3851,7 +3855,12 @@ LibraryManager.library = {
38513855
throw e;
38523856
}
38533857
}
3854-
maybeExit();
3858+
#if EXIT_RUNTIME || USE_PTHREADS
3859+
#if USE_PTHREADS && !EXIT_RUNTIME
3860+
if (ENVIRONMENT_IS_PTHREAD)
3861+
#endif
3862+
maybeExit();
3863+
#endif
38553864
},
38563865

38573866
$maybeExit__deps: ['exit',
@@ -3883,8 +3892,6 @@ LibraryManager.library = {
38833892
},
38843893
#else
38853894
// MINIMAL_RUNTIME doesn't support the runtimeKeepalive stuff
3886-
$runtimeKeepalivePush: function() {},
3887-
$runtimeKeepalivePop: function() {},
38883895
$callUserCallback: function(func) {
38893896
func();
38903897
},

0 commit comments

Comments
 (0)