From ea27be2a85c471101dbd33744dacbc645357bf11 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Mon, 30 Sep 2024 15:59:59 -0700 Subject: [PATCH] Move debug check to runtime_debug.js. NFC (#22659) --- src/runtime_debug.js | 4 ++++ src/shell.js | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) 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)