@@ -94,8 +94,8 @@ if (!ENVIRONMENT_IS_PTHREAD) PthreadWorkerInit = {};
94
94
var currentScriptUrl = ( typeof document !== 'undefined' && document . currentScript ) ? document . currentScript . src : undefined ;
95
95
#endif
96
96
97
- if ( ENVIRONMENT_IS_NODE ) {
98
97
#if ENVIRONMENT_MAY_BE_NODE
98
+ if ( ENVIRONMENT_IS_NODE ) {
99
99
// Expose functionality in the same simple way that the shells work
100
100
// Note that we pollute the global namespace here, otherwise we break in node
101
101
var nodeFS ;
@@ -162,10 +162,10 @@ if (ENVIRONMENT_IS_NODE) {
162
162
#if ASSERTIONS
163
163
throw new Error ( 'runtime environment is node, but not compiled with support for that' ) ;
164
164
#endif // ASSERTIONS
165
+ } else
165
166
#endif // ENVIRONMENT_MAY_BE_NODE
166
- }
167
- else if ( ENVIRONMENT_IS_SHELL ) {
168
167
#if ENVIRONMENT_MAY_BE_SHELL
168
+ if ( ENVIRONMENT_IS_SHELL ) {
169
169
if ( typeof read != 'undefined' ) {
170
170
Module [ 'read' ] = function shell_read ( f ) {
171
171
#if SUPPORT_BASE64_EMBEDDING
@@ -209,10 +209,10 @@ else if (ENVIRONMENT_IS_SHELL) {
209
209
#if ASSERTIONS
210
210
throw new Error ( 'runtime environment is shell , but not compiled with support for that ') ;
211
211
#endif // ASSERTIONS
212
+ } else
212
213
#endif // ENVIRONMENT_MAY_BE_SHELL
213
- }
214
- else if ( ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER ) {
215
214
#if ENVIRONMENT_MAY_BE_WEB_OR_WORKER
215
+ if ( ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER ) {
216
216
Module [ 'read '] = function shell_read ( url ) {
217
217
#if SUPPORT_BASE64_EMBEDDING
218
218
try {
@@ -281,14 +281,13 @@ else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
281
281
#if ASSERTIONS
282
282
throw new Error ( 'runtime environment is web or worker, but not compiled with support for that' ) ;
283
283
#endif // ASSERTIONS
284
+ } else
284
285
#endif // ENVIRONMENT_MAY_BE_WEB_OR_WORKER
285
- }
286
+ {
286
287
#if ASSERTIONS
287
- else {
288
- // Unreachable because SHELL is dependent on the others
289
288
throw new Error ( 'unknown runtime environment' ) ;
290
- }
291
289
#endif // ASSERTIONS
290
+ }
292
291
293
292
// console.log is checked first, as 'print' on the web will open a print dialogue
294
293
// printErr is preferable to console.warn (works better in shells)
0 commit comments