From 0b47a4dc519ada9c56d6f4d62865c2d96a56510c Mon Sep 17 00:00:00 2001 From: Pavel Savara Date: Fri, 27 Jan 2023 22:32:00 +0100 Subject: [PATCH] [browser][MT] conditional revert of wasm imports optimization (#81275) * conditional revert of https://github.com/dotnet/runtime/pull/79466 * feedback --- src/mono/wasm/runtime/es6/dotnet.es6.lib.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mono/wasm/runtime/es6/dotnet.es6.lib.js b/src/mono/wasm/runtime/es6/dotnet.es6.lib.js index fb184f0..19f877f 100644 --- a/src/mono/wasm/runtime/es6/dotnet.es6.lib.js +++ b/src/mono/wasm/runtime/es6/dotnet.es6.lib.js @@ -121,7 +121,12 @@ const linked_functions = [ // -- this javascript file is evaluated by emcc during compilation! -- // we generate simple proxy for each exported function so that emcc will include them in the final output for (let linked_function of linked_functions) { - DotnetSupportLib[linked_function] = new Function(""); + #if USE_PTHREADS + const fn_template = `return __dotnet_runtime.__linker_exports.${linked_function}.apply(__dotnet_runtime, arguments)`; + DotnetSupportLib[linked_function] = new Function(fn_template); + #else + DotnetSupportLib[linked_function] = new Function('throw new Error("unreachable");'); + #endif } autoAddDeps(DotnetSupportLib, "$DOTNET"); -- 2.7.4