Skip to content

Commit 35f8f79

Browse files
authored
Avoid outputting shell code when !ENVIRONMENT_MAY_BE_SHELL. NFC (#21565)
1 parent be8f1d1 commit 35f8f79

7 files changed

+9
-7
lines changed

src/shell.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ if (ENVIRONMENT_IS_SHELL) {
282282
if ((typeof process == 'object' && typeof require === 'function') || typeof window == 'object' || typeof importScripts == 'function') throw new Error('not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)');
283283
#endif
284284

285+
#if ENVIRONMENT_MAY_BE_SHELL
285286
if (typeof read != 'undefined') {
286287
read_ = read;
287288
}
@@ -352,9 +353,10 @@ if (ENVIRONMENT_IS_SHELL) {
352353
eval(read(locateFile('{{{ TARGET_BASENAME }}}.wasm.js'))+'');
353354
}
354355
#endif
356+
#endif // ENVIRONMENT_MAY_BE_SHELL
355357

356358
} else
357-
#endif // ENVIRONMENT_MAY_BE_SHELL
359+
#endif // ENVIRONMENT_MAY_BE_SHELL || ASSERTIONS
358360

359361
// Note that this includes Node.js workers when relevant (pthreads is enabled).
360362
// Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8337
1+
8114
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22876
1+
21940
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6854
1+
6704
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18720
1+
18068
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
57832
1+
55484
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
56735
1+
54387

0 commit comments

Comments
 (0)