diff --git a/src/runtime_debug.js b/src/runtime_debug.js index 89785a5710a9..a30bf4e92765 100644 --- a/src/runtime_debug.js +++ b/src/runtime_debug.js @@ -16,6 +16,10 @@ })(); #endif +if (Module['ENVIRONMENT']) { + 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)'); +} + function legacyModuleProp(prop, newName, incoming=true) { if (!Object.getOwnPropertyDescriptor(Module, prop)) { Object.defineProperty(Module, prop, { diff --git a/src/shell.js b/src/shell.js index 104ceb4ce9b1..c1670122c527 100644 --- a/src/shell.js +++ b/src/shell.js @@ -104,12 +104,6 @@ var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIR #endif #endif // ENVIRONMENT -#if ASSERTIONS -if (Module['ENVIRONMENT']) { - 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)'); -} -#endif - #if PTHREADS // Three configurations we can be running in: // 1) We could be the application main() thread running in the main JS UI thread. (ENVIRONMENT_IS_WORKER == false and ENVIRONMENT_IS_PTHREAD == false)