Skip to content

Commit 9f4360a

Browse files
authored
shell.js: Remove moduleOverrides. NFC (emscripten-core#23991)
This mechanism was added back in 80f517d so that shell code could unconditionally assign to the `Module` object without clobbering the incoming values there. These days the shell code no longer assigns to the Module object so it is no longer necessary. Basically this code protects against accidental assignments to `Module` between lines 138 and 408, but we don't have any such assignments that I can see in our code.
1 parent 24ee99a commit 9f4360a

File tree

88 files changed

+88
-101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+88
-101
lines changed

src/shell.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,6 @@ var ENVIRONMENT_IS_WASM_WORKER = !!Module['$ww'];
129129
// refer to Module (if they choose; they can also define Module)
130130
{{{ preJS() }}}
131131

132-
// Sometimes an existing Module object exists with properties
133-
// meant to overwrite the default module functionality. Here
134-
// we collect those properties and reapply _after_ we configure
135-
// the current environment's defaults to avoid having to be so
136-
// defensive during initialization.
137-
var moduleOverrides = {...Module};
138-
139132
var arguments_ = [];
140133
var thisProgram = './this.program';
141134
var quit_ = (status, toThrow) => {
@@ -218,9 +211,8 @@ if (ENVIRONMENT_IS_NODE) {
218211

219212
arguments_ = process.argv.slice(2);
220213

221-
#if MODULARIZE
214+
#if !MODULARIZE
222215
// MODULARIZE will export the module in the proper place outside, we don't need to export here
223-
#else
224216
if (typeof module != 'undefined') {
225217
module['exports'] = Module;
226218
}
@@ -406,11 +398,6 @@ if (ENVIRONMENT_IS_NODE) {
406398
{{{ makeModuleReceiveWithVar('err', 'printErr', 'console.error.bind(console)', true) }}}
407399
#endif
408400

409-
// Merge back in the overrides
410-
Object.assign(Module, moduleOverrides);
411-
// Free the object hierarchy contained in the overrides, this lets the GC
412-
// reclaim data used.
413-
moduleOverrides = null;
414401
#if ASSERTIONS
415402
checkIncomingModuleAPI();
416403
#endif
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4133
1+
4091
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8240
1+
8223
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19983
1+
19945
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8229
1+
8212
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19961
1+
19923
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9240
1+
9221
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
23720
1+
23682
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8189
1+
8167
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19875
1+
19837

0 commit comments

Comments
 (0)