Skip to content

Commit ea27be2

Browse files
authored
Move debug check to runtime_debug.js. NFC (#22659)
1 parent a17e9d1 commit ea27be2

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/runtime_debug.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
})();
1717
#endif
1818

19+
if (Module['ENVIRONMENT']) {
20+
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)');
21+
}
22+
1923
function legacyModuleProp(prop, newName, incoming=true) {
2024
if (!Object.getOwnPropertyDescriptor(Module, prop)) {
2125
Object.defineProperty(Module, prop, {

src/shell.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,6 @@ var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIR
104104
#endif
105105
#endif // ENVIRONMENT
106106

107-
#if ASSERTIONS
108-
if (Module['ENVIRONMENT']) {
109-
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)');
110-
}
111-
#endif
112-
113107
#if PTHREADS
114108
// Three configurations we can be running in:
115109
// 1) We could be the application main() thread running in the main JS UI thread. (ENVIRONMENT_IS_WORKER == false and ENVIRONMENT_IS_PTHREAD == false)

0 commit comments

Comments
 (0)