Skip to content

Commit ea06e07

Browse files
authored
Simplify code in a few MINIMAL_RUNTIME preamble assignments. (#16357)
1 parent 2a318a2 commit ea06e07

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/preamble_minimal.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ function assert(condition, text) {
1515

1616
/** @param {string|number=} what */
1717
function abort(what) {
18-
#if ASSERTIONS
19-
throw new Error(what);
20-
#else
21-
throw what;
22-
#endif
18+
throw {{{ ASSERTIONS ? 'new Error(what)' : 'what' }}};
2319
}
2420

2521
#if SAFE_HEAP
@@ -96,11 +92,7 @@ if (!ENVIRONMENT_IS_PTHREAD) {
9692
updateGlobalBufferAndViews(wasmMemory.buffer);
9793
#if USE_PTHREADS
9894
} else {
99-
#if MODULARIZE
100-
updateGlobalBufferAndViews(Module.buffer);
101-
#else
102-
updateGlobalBufferAndViews(wasmMemory.buffer);
103-
#endif
95+
updateGlobalBufferAndViews({{{ MODULARIZE ? 'Module.buffer' : 'wasmMemory.buffer' }}});
10496
}
10597
#endif // USE_PTHREADS
10698
#endif // IMPORTED_MEMORY

0 commit comments

Comments
 (0)