Skip to content

Commit 7a2ee39

Browse files
authored
Move some Module object assertions. NFC (emscripten-core#23995)
This moves these assertion alongside other similar checks.
1 parent 1a97955 commit 7a2ee39

9 files changed

+9
-14
lines changed

src/preamble.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ var isFileURI = (filename) => filename.startsWith('file://');
150150

151151
#include "runtime_shared.js"
152152

153-
#if ASSERTIONS
154-
assert(!Module['STACK_SIZE'], 'STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time')
155-
#endif
156-
157153
#if ASSERTIONS
158154
assert(typeof Int32Array != 'undefined' && typeof Float64Array !== 'undefined' && Int32Array.prototype.subarray != undefined && Int32Array.prototype.set != undefined,
159155
'JS engine does not provide full typed array support');

src/runtime_debug.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
})();
1717
#endif
1818

19-
if (Module['ENVIRONMENT']) {
20-
throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');
21-
}
22-
2319
function legacyModuleProp(prop, newName, incoming=true) {
2420
if (!Object.getOwnPropertyDescriptor(Module, prop)) {
2521
Object.defineProperty(Module, prop, {

src/shell.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,9 @@ assert(typeof Module['readAsync'] == 'undefined', 'Module.readAsync option was r
423423
assert(typeof Module['readBinary'] == 'undefined', 'Module.readBinary option was removed (modify readBinary in JS)');
424424
assert(typeof Module['setWindowTitle'] == 'undefined', 'Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)');
425425
assert(typeof Module['TOTAL_MEMORY'] == 'undefined', 'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY');
426+
assert(typeof Module['ENVIRONMENT'] == 'undefined', 'Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');
427+
assert(typeof Module['STACK_SIZE'] == 'undefined', 'STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time')
428+
426429
{{{ makeRemovedModuleAPIAssert('asm', 'wasmExports', false) }}}
427430
{{{ makeRemovedModuleAPIAssert('readAsync') }}}
428431
{{{ makeRemovedModuleAPIAssert('readBinary') }}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7956
1+
7940
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
21272
1+
21295
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6297
1+
6284
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16628
1+
16651
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
52217
1+
52240
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
50430
1+
50453

0 commit comments

Comments
 (0)