Skip to content

Commit cd8d638

Browse files
committed
Always assert on calling proxied function from wasm worker. NFC
Follow up to #20135. See #20135 (comment)
1 parent 9bdb310 commit cd8d638

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/jsifier.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ if (ENVIRONMENT_IS_PTHREAD)
247247
${body}
248248
}\n`
249249
});
250-
} else if (WASM_WORKERS && ASSERTIONS) {
250+
}
251+
if (WASM_WORKERS && ASSERTIONS) {
251252
// In ASSERTIONS builds add runtime checks that proxied functions are not attempted to be called in Wasm Workers
252253
// (since there is no automatic proxying architecture available)
253254
snippet = modifyJSFunction(snippet, (args, body) => `

src/library.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3769,7 +3769,7 @@ function wrapSyscallFunction(x, library, isWasi) {
37693769
if (!WASMFS) {
37703770
library[x + '__deps'].push('$SYSCALLS');
37713771
}
3772-
#if PTHREADS
3772+
37733773
// Most syscalls need to happen on the main JS thread (e.g. because the
37743774
// filesystem is in JS and on that thread). Proxy synchronously to there.
37753775
// There are some exceptions, syscalls that we know are ok to just run in
@@ -3782,5 +3782,4 @@ function wrapSyscallFunction(x, library, isWasi) {
37823782
if (library[x + '__proxy'] === undefined) {
37833783
library[x + '__proxy'] = 'sync';
37843784
}
3785-
#endif
37863785
}

0 commit comments

Comments
 (0)