Skip to content

Commit 80f1fae

Browse files
authored
[browser][mono] ST build is always sidecar on a worker (#121879)
1 parent 56cb23a commit 80f1fae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/mono/browser/runtime/loader/globals.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
/* eslint-disable @typescript-eslint/triple-slash-reference */
55
/// <reference path="../types/sidecar.d.ts" />
66

7+
import WasmEnableThreads from "consts:wasmEnableThreads";
8+
79
import { exceptions, simd, relaxedSimd } from "wasm-feature-detect";
810

911
import gitHash from "consts:gitHash";
@@ -17,8 +19,8 @@ import { mono_log_error, set_thread_prefix, setup_proxy_console } from "./loggin
1719
import { invokeLibraryInitializers } from "./libraryInitializers";
1820
import { deep_merge_config, isDebuggingSupported } from "./config";
1921

20-
// if we are the first script loaded in the web worker, we are expected to become the sidecar
21-
if (typeof importScripts === "function" && !globalThis.onmessage) {
22+
// if we are ST build or the first script loaded in the web worker, we are expected to become the sidecar
23+
if (typeof importScripts === "function" && (!WasmEnableThreads || !globalThis.onmessage)) {
2224
(globalThis as any).dotnetSidecar = true;
2325
}
2426

0 commit comments

Comments
 (0)