You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was duplicated in quite a few places and slightly different in some
places.
This change reduces that size of the code a little and reduces the
number of places we specify it to just two.
This change also fixes the `instance.test_environment` test which was
failing due to broken nodejs detection in shell.js (it was checking for
`require` which doesn't exist in ES module mode).
Split out from #24344
if(typeofprocess== 'undefined' ||!process.release||process.release.name!== 'node')thrownewError('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?)');
196
+
constisNode={{{ nodeDetectionCode()}}};
197
+
if(!isNode)thrownewError('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?)');
197
198
#endif
198
199
199
200
#if ASSERTIONS
@@ -276,7 +277,8 @@ if (ENVIRONMENT_IS_NODE) {
276
277
if(ENVIRONMENT_IS_SHELL){
277
278
278
279
#if ENVIRONMENT&&ASSERTIONS
279
-
if((typeofprocess=='object'&&typeofrequire==='function')||typeofwindow=='object'||typeofWorkerGlobalScope!='undefined')thrownewError('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?)');
280
+
constisNode={{{ nodeDetectionCode()}}};
281
+
if(isNode||typeofwindow=='object'||typeofWorkerGlobalScope!='undefined')thrownewError('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?)');
0 commit comments