Skip to content

Commit 3afdb87

Browse files
committed
WasmEnableLegacyJsInterop
1 parent 82871f4 commit 3afdb87

File tree

19 files changed

+86
-31
lines changed

19 files changed

+86
-31
lines changed

eng/testing/tests.wasm.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<BuildAOTTestsOn Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(Scenario)' == 'BuildWasmApps'">helix</BuildAOTTestsOn>
3434
<BuildAOTTestsOn Condition="'$(BuildAOTTestsOnHelix)' == 'true'">helix</BuildAOTTestsOn>
3535
<BuildAOTTestsOn Condition="'$(BuildAOTTestsOn)' == ''">local</BuildAOTTestsOn>
36+
<WasmEnableLegacyJsInterop Condition="'$(WasmEnableLegacyJsInterop)' == ''">true</WasmEnableLegacyJsInterop>
3637
</PropertyGroup>
3738

3839
<PropertyGroup Condition="'$(BuildAOTTestsOn)' == 'local'">
@@ -49,6 +50,11 @@
4950
<_ExtraTrimmerArgs Condition="'$(WasmEnableSIMD)' == 'true' and '$(RunAOTCompilation)' == 'true'">$(_ExtraTrimmerArgs) --substitutions &quot;$(MonoProjectRoot)\wasm\build\ILLink.Substitutions.WasmIntrinsics.xml&quot;</_ExtraTrimmerArgs>
5051
<_ExtraTrimmerArgs Condition="'$(WasmEnableSIMD)' != 'true' or '$(RunAOTCompilation)' != 'true'">$(_ExtraTrimmerArgs) --substitutions &quot;$(MonoProjectRoot)\wasm\build\ILLink.Substitutions.NoWasmIntrinsics.xml&quot;</_ExtraTrimmerArgs>
5152
</PropertyGroup>
53+
<ItemGroup Condition="'$(BuildAOTTestsOn)' == 'helix'">
54+
<TrimmerRootDescriptor
55+
Condition="'$(WasmEnableLegacyJsInterop)' == 'true'"
56+
Include="$(MonoProjectRoot)\wasm\build\ILLink.Descriptors.LegacyJsInterop.xml" />
57+
</ItemGroup>
5258

5359
<ItemGroup>
5460
<_AOT_InternalForceInterpretAssemblies Include="@(HighAotMemoryUsageAssembly)" />

src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@
252252
<PlatformManifestFileEntry Include="emcc-props.json" IsNative="true" />
253253
<PlatformManifestFileEntry Include="ILLink.Substitutions.WasmIntrinsics.xml" IsNative="true" />
254254
<PlatformManifestFileEntry Include="ILLink.Substitutions.NoWasmIntrinsics.xml" IsNative="true" />
255+
<PlatformManifestFileEntry Include="ILLink.Descriptors.LegacyJsInterop.xml" IsNative="true" />
255256
<!-- wasi specific -->
256257
<PlatformManifestFileEntry Include="main.c" IsNative="true" />
257258
<PlatformManifestFileEntry Include="driver.h" IsNative="true" />

src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
<PropertyGroup>
33
<TargetFrameworks>$(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)</TargetFrameworks>
44
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
5-
<FeatureWasmThreads Condition="'$(TargetOS)' == 'browser' and '$(MonoWasmBuildVariant)' == 'multithread'">true</FeatureWasmThreads>
6-
<DefineConstants Condition="'$(FeatureWasmThreads)' == 'true'" >$(DefineConstants);FEATURE_WASM_THREADS</DefineConstants>
75
<EnableAOTAnalyzer>false</EnableAOTAnalyzer>
86
</PropertyGroup>
97

108
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
119
<PropertyGroup>
1210
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
1311
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' != 'browser'">SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
12+
<WasmEnableLegacyJsInterop Condition="'$(WasmEnableLegacyJsInterop)' == ''">true</WasmEnableLegacyJsInterop>
13+
<DefineConstants Condition="'$(FeatureWasmThreads)' == 'true'" >$(DefineConstants);FEATURE_WASM_THREADS</DefineConstants>
14+
<DefineConstants Condition="'$(WasmEnableLegacyJsInterop)' == 'true'" >$(DefineConstants);ENABLE_LEGACY_JS_INTEROP</DefineConstants>
15+
<ILLinkDescriptorsLibraryBuildXml
16+
Condition="'$(TargetPlatformIdentifier)' == 'browser' and '$(WasmEnableLegacyJsInterop)' == 'true'"
17+
>$(MonoProjectRoot)wasm\build\ILLink.Descriptors.LegacyJsInterop.xml</ILLinkDescriptorsLibraryBuildXml>
1418
</PropertyGroup>
1519

1620
<ItemGroup>
@@ -22,15 +26,6 @@
2226
<Compile Include="System\Runtime\InteropServices\JavaScript\Interop\JavaScriptImports.Generated.cs" />
2327
<Compile Include="System\Runtime\InteropServices\JavaScript\Interop\JavaScriptExports.cs" />
2428
<Compile Include="System\Runtime\InteropServices\JavaScript\Interop\JavaScriptImports.cs" />
25-
<Compile Include="System\Runtime\InteropServices\JavaScript\Interop\LegacyExports.cs" />
26-
27-
<Compile Include="System\Runtime\InteropServices\JavaScript\Legacy\Runtime.cs" />
28-
<Compile Include="System\Runtime\InteropServices\JavaScript\Legacy\Array.cs" />
29-
<Compile Include="System\Runtime\InteropServices\JavaScript\Legacy\ArrayBuffer.cs" />
30-
<Compile Include="System\Runtime\InteropServices\JavaScript\Legacy\DataView.cs" />
31-
<Compile Include="System\Runtime\InteropServices\JavaScript\Legacy\Function.cs" />
32-
<Compile Include="System\Runtime\InteropServices\JavaScript\Legacy\Uint8Array.cs" />
33-
<Compile Include="System\Runtime\InteropServices\JavaScript\Legacy\LegacyHostImplementation.cs" />
3429

3530
<Compile Include="System\Runtime\InteropServices\JavaScript\JSHost.cs" />
3631
<Compile Include="System\Runtime\InteropServices\JavaScript\JSMarshalerType.cs" />
@@ -69,6 +64,18 @@
6964
<Compile Include="System\Runtime\InteropServices\JavaScript\JSSynchronizationContext.cs" />
7065
</ItemGroup>
7166

67+
<!-- only include legacy interop when WasmEnableLegacyJsInterop is enabled -->
68+
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'browser' and '$(WasmEnableLegacyJsInterop)' == 'true'">
69+
<Compile Include="System\Runtime\InteropServices\JavaScript\Interop\LegacyExports.cs" />
70+
<Compile Include="System\Runtime\InteropServices\JavaScript\Legacy\Runtime.cs" />
71+
<Compile Include="System\Runtime\InteropServices\JavaScript\Legacy\Array.cs" />
72+
<Compile Include="System\Runtime\InteropServices\JavaScript\Legacy\ArrayBuffer.cs" />
73+
<Compile Include="System\Runtime\InteropServices\JavaScript\Legacy\DataView.cs" />
74+
<Compile Include="System\Runtime\InteropServices\JavaScript\Legacy\Function.cs" />
75+
<Compile Include="System\Runtime\InteropServices\JavaScript\Legacy\Uint8Array.cs" />
76+
<Compile Include="System\Runtime\InteropServices\JavaScript\Legacy\LegacyHostImplementation.cs" />
77+
</ItemGroup>
78+
7279
<ItemGroup>
7380
<Reference Include="System.Collections" />
7481
<Reference Include="System.Memory" />

src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Interop/JavaScriptImports.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public static void MarshalPromise(Span<JSMarshalerArgument> arguments)
2020
}
2121
}
2222

23+
#if ENABLE_LEGACY_JS_INTEROP
2324
#region legacy
2425

2526
public static object GetGlobalObject(string? str = null)
@@ -30,7 +31,7 @@ public static object GetGlobalObject(string? str = null)
3031
if (exception != 0)
3132
throw new JSException(SR.Format(SR.ErrorResolvingFromGlobalThis, str));
3233

33-
JSHostImplementation.ReleaseInFlight(jsObj);
34+
LegacyHostImplementation.ReleaseInFlight(jsObj);
3435
return jsObj;
3536
}
3637

@@ -44,5 +45,6 @@ public static IntPtr CreateCSOwnedObject(string typeName, object[] parms)
4445
}
4546

4647
#endregion
48+
#endif
4749
}
4850
}

src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Interop/LegacyExports.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
namespace System.Runtime.InteropServices.JavaScript
1111
{
12-
// this maps to src\mono\wasm\runtime\legacy\corebindings.ts
13-
// the public methods are protected from trimming by DynamicDependency on JSFunctionBinding.BindJSFunction
12+
// the public methods are protected from trimming by ILLink.Descriptors.LegacyJsInterop.xml
1413
internal static unsafe partial class LegacyExports
1514
{
1615
public static void GetCSOwnedObjectByJSHandleRef(nint jsHandle, int shouldAddInflight, out JSObject? result)

src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSFunctionBinding.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ public static void InvokeJS(JSFunctionBinding signature, Span<JSMarshalerArgumen
142142
/// <exception cref="PlatformNotSupportedException">The method is executed on an architecture other than WebAssembly.</exception>
143143
// JavaScriptExports need to be protected from trimming because they are used from C/JS code which IL linker can't see
144144
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, "System.Runtime.InteropServices.JavaScript.JavaScriptExports", "System.Runtime.InteropServices.JavaScript")]
145-
// TODO make this DynamicDependency conditional
146-
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, "System.Runtime.InteropServices.JavaScript.LegacyExports", "System.Runtime.InteropServices.JavaScript")]
147145
public static JSFunctionBinding BindJSFunction(string functionName, string moduleName, ReadOnlySpan<JSMarshalerType> signatures)
148146
{
149147
if (RuntimeInformation.OSArchitecture != Architecture.Wasm)

src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSHostImplementation.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@ public static void ReleaseCSOwnedObject(nint jsHandle)
4242
throw new InvalidOperationException();
4343
}
4444

45-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
46-
public static void ReleaseInFlight(object obj)
47-
{
48-
JSObject? jsObj = obj as JSObject;
49-
jsObj?.ReleaseInFlight();
50-
}
51-
5245
// A JSOwnedObject is a managed object with its lifetime controlled by javascript.
5346
// The managed side maintains a strong reference to the object, while the JS side
5447
// maintains a weak reference and notifies the managed side if the JS wrapper object

src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/JSObject.References.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ public partial class JSObject
1010
{
1111
internal nint JSHandle;
1212

13+
#if ENABLE_LEGACY_JS_INTEROP
1314
internal GCHandle? InFlight;
1415
internal int InFlightCounter;
16+
#endif
1517
private bool _isDisposed;
1618

1719
internal JSObject(IntPtr jsHandle)
1820
{
1921
JSHandle = jsHandle;
20-
InFlight = null;
21-
InFlightCounter = 0;
2222
}
2323

24+
#if ENABLE_LEGACY_JS_INTEROP
2425
internal void AddInFlight()
2526
{
2627
ObjectDisposedException.ThrowIf(IsDisposed, this);
@@ -53,6 +54,7 @@ internal void ReleaseInFlight()
5354
}
5455
}
5556
}
57+
#endif
5658

5759
/// <inheritdoc />
5860
public override bool Equals([NotNullWhen(true)] object? obj) => obj is JSObject other && JSHandle == other.JSHandle;

src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Legacy/Array.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public object this[int i]
9191

9292
if (exception != 0)
9393
throw new JSException((string)indexValue);
94-
JSHostImplementation.ReleaseInFlight(indexValue);
94+
LegacyHostImplementation.ReleaseInFlight(indexValue);
9595
return indexValue;
9696
}
9797
set

src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Legacy/LegacyHostImplementation.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ namespace System.Runtime.InteropServices.JavaScript
1010
[SupportedOSPlatform("browser")]
1111
internal static class LegacyHostImplementation
1212
{
13+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
14+
public static void ReleaseInFlight(object obj)
15+
{
16+
JSObject? jsObj = obj as JSObject;
17+
jsObj?.ReleaseInFlight();
18+
}
19+
1320
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1421
public static void RegisterCSOwnedObject(JSObject proxy)
1522
{

src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Legacy/Runtime.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static object Invoke(this JSObject self, string method, params object?[]
3939
Interop.Runtime.InvokeJSWithArgsRef(self.JSHandle, method, args, out int exception, out object res);
4040
if (exception != 0)
4141
throw new JSException((string)res);
42-
JSHostImplementation.ReleaseInFlight(res);
42+
LegacyHostImplementation.ReleaseInFlight(res);
4343
return res;
4444
}
4545

@@ -74,7 +74,7 @@ public static object GetObjectProperty(this JSObject self, string name)
7474
Interop.Runtime.GetObjectPropertyRef(self.JSHandle, name, out int exception, out object propertyValue);
7575
if (exception != 0)
7676
throw new JSException((string)propertyValue);
77-
JSHostImplementation.ReleaseInFlight(propertyValue);
77+
LegacyHostImplementation.ReleaseInFlight(propertyValue);
7878
return propertyValue;
7979
}
8080

src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.Legacy.UnitTests/System.Runtime.InteropServices.JavaScript.Legacy.UnitTests.csproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
<TestRuntime>true</TestRuntime>
66
<WasmXHarnessArgs>$(WasmXHarnessArgs) --engine-arg=--expose-gc --web-server-use-cop</WasmXHarnessArgs>
77
<NoWarn>0612</NoWarn>
8+
<WasmEnableLegacyJsInterop Condition="'$(WasmEnableLegacyJsInterop)' == ''">true</WasmEnableLegacyJsInterop>
9+
<DefineConstants Condition="'$(WasmEnableLegacyJsInterop)' == 'true'">$(DefineConstants);ENABLE_LEGACY_JS_INTEROP</DefineConstants>
810
</PropertyGroup>
9-
<ItemGroup>
11+
12+
<ItemGroup Condition="'$(WasmEnableLegacyJsInterop)' == 'true'">
1013
<Compile Include="System\Runtime\InteropServices\JavaScript\JavaScriptTests.cs" />
1114
<Compile Include="System\Runtime\InteropServices\JavaScript\DataViewTests.cs" />
1215
<Compile Include="System\Runtime\InteropServices\JavaScript\MemoryTests.cs" />
@@ -16,9 +19,12 @@
1619
<Compile Include="System\Runtime\InteropServices\JavaScript\DelegateTests.cs" />
1720
<Compile Include="System\Runtime\InteropServices\JavaScript\HelperMarshal.cs" />
1821
<Compile Include="System\Runtime\InteropServices\JavaScript\Http\HttpRequestMessageTest.cs" />
22+
<Compile Include="$(LibrariesProjectRoot)System.Runtime.InteropServices.JavaScript\tests\System.Runtime.InteropServices.JavaScript.UnitTests\System\Runtime\InteropServices\JavaScript\Utils.cs" Link="System\Runtime\InteropServices\JavaScript\Utils.cs" />
23+
</ItemGroup>
24+
25+
<ItemGroup>
1926
<Compile Include="System\Runtime\InteropServices\JavaScript\ParallelTests.cs" />
2027
<Compile Include="System\Runtime\InteropServices\JavaScript\TimerTests.cs" />
21-
<Compile Include="$(LibrariesProjectRoot)System.Runtime.InteropServices.JavaScript\tests\System.Runtime.InteropServices.JavaScript.UnitTests\System\Runtime\InteropServices\JavaScript\Utils.cs" Link="System\Runtime\InteropServices\JavaScript\Utils.cs" />
2228
</ItemGroup>
2329

2430
<ItemGroup>

src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<TargetFrameworks>$(NetCoreAppCurrent)-browser</TargetFrameworks>
55
<TestRuntime>true</TestRuntime>
66
<WasmXHarnessArgs>$(WasmXHarnessArgs) --engine-arg=--expose-gc --web-server-use-cop</WasmXHarnessArgs>
7+
<WasmEnableLegacyJsInterop Condition="'$(WasmEnableLegacyJsInterop)' == ''">true</WasmEnableLegacyJsInterop>
8+
<DefineConstants Condition="'$(WasmEnableLegacyJsInterop)' == 'true'">$(DefineConstants);ENABLE_LEGACY_JS_INTEROP</DefineConstants>
79
<!-- Use following lines to write the generated files to disk. -->
810
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
911
</PropertyGroup>

src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportExportTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ public unsafe void GlobalThis()
5858
[Fact]
5959
public unsafe void DotnetInstance()
6060
{
61+
#if ENABLE_LEGACY_JS_INTEROP
6162
Assert.True(JSHost.DotnetInstance.HasProperty("MONO"));
6263
Assert.Equal("object", JSHost.DotnetInstance.GetTypeOfProperty("MONO"));
64+
#endif
6365

6466
JSHost.DotnetInstance.SetProperty("testBool", true);
6567
Assert.Equal("boolean", JSHost.DotnetInstance.GetTypeOfProperty("testBool"));

src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/Microsoft.NET.Runtime.WebAssembly.Sdk.pkgproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<PackageFile Include="Sdk\AutoImport.props" TargetPath="Sdk" />
1414
<PackageFile Include="Sdk\Sdk.props" TargetPath="Sdk" />
1515
<PackageFile Include="$(RepoRoot)\src\mono\wasm\build\ILLink.Substitutions.*.xml" TargetPath="Sdk" />
16+
<PackageFile Include="$(RepoRoot)\src\mono\wasm\build\ILLink.Descriptors.*.xml" TargetPath="Sdk" />
1617
<PackageFile Include="$(RepoRoot)\src\mono\wasm\build\WasmApp.props" TargetPath="Sdk" />
1718
<PackageFile Include="$(RepoRoot)\src\mono\wasm\build\WasmApp.targets" TargetPath="Sdk" />
1819
<PackageFile Include="$(RepoRoot)\src\mono\wasm\build\WasmApp.Native.*" TargetPath="Sdk" />
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<linker>
2+
<!-- LegacyExports need to be protected from trimming because methods are used from C/JS code which IL linker can't see -->
3+
<assembly fullname="System.Runtime.InteropServices.JavaScript">
4+
<type fullname="System.Runtime.InteropServices.JavaScript.LegacyExports">
5+
<method name="GetCSOwnedObjectByJSHandleRef" />
6+
<method name="GetCSOwnedObjectJSHandleRef" />
7+
<method name="TryGetCSOwnedObjectJSHandleRef" />
8+
<method name="CreateCSOwnedProxyRef" />
9+
<method name="GetJSOwnedObjectByGCHandleRef" />
10+
<method name="GetJSOwnedObjectGCHandleRef" />
11+
<method name="CreateTaskSource" />
12+
<method name="SetTaskSourceResultRef" />
13+
<method name="SetTaskSourceFailure" />
14+
<method name="GetTaskSourceTaskRef" />
15+
<method name="SetupJSContinuationRef" />
16+
<method name="ObjectToStringRef" />
17+
<method name="GetDateValueRef" />
18+
<method name="CreateDateTimeRef" />
19+
<method name="CreateUriRef" />
20+
<method name="IsSimpleArrayRef" />
21+
<method name="GetCallSignatureRef" />
22+
</type>
23+
</assembly>
24+
</linker>

src/mono/wasm/build/WasmApp.targets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@
135135

136136
<SupportedPlatform Condition="'$(IsBrowserWasmProject)' == 'true'" Remove="@(SupportedPlatform)" />
137137
<SupportedPlatform Condition="'$(IsBrowserWasmProject)' == 'true'" Include="browser" />
138+
139+
<TrimmerRootDescriptor
140+
Condition="'$(WasmEnableLegacyJsInterop)' == 'true'"
141+
Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.LegacyJsInterop.xml" />
138142
</ItemGroup>
139143

140144
<PropertyGroup Label="Identify app bundle directory to run from">

src/mono/wasm/runtime/net6-legacy/corebindings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function init_legacy_exports(): void {
8888
legacyHelpers.runtime_legacy_exports_classname = "LegacyExports";
8989
legacyHelpers.runtime_legacy_exports_class = cwraps.mono_wasm_assembly_find_class(runtimeHelpers.runtime_interop_module, runtimeHelpers.runtime_interop_namespace, legacyHelpers.runtime_legacy_exports_classname);
9090
if (!legacyHelpers.runtime_legacy_exports_class)
91-
throw "Can't find " + runtimeHelpers.runtime_interop_namespace + "." + runtimeHelpers.runtime_interop_exports_classname + " class";
91+
throw "Can't find " + runtimeHelpers.runtime_interop_namespace + "." + legacyHelpers.runtime_legacy_exports_classname + " class";
9292

9393
for (const sig of fn_signatures) {
9494
const wf: any = legacyManagedExports;

src/mono/wasm/wasm.proj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<ICULibDir Condition="'$(MonoWasmThreads)' != 'true'">$([MSBuild]::NormalizeDirectory('$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)', 'runtimes', 'browser-wasm', 'native', 'lib'))</ICULibDir>
2828
<ICULibDir Condition="'$(MonoWasmThreads)' == 'true'">$([MSBuild]::NormalizeDirectory('$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)', 'runtimes', 'browser-wasm-threads', 'native', 'lib'))</ICULibDir>
2929
<WasmEnableSIMD Condition="'$(WasmEnableSIMD)' == ''">false</WasmEnableSIMD>
30+
<WasmEnableLegacyJsInterop Condition="'$(WasmEnableLegacyJsInterop)' == ''">true</WasmEnableLegacyJsInterop>
3031
<FilterSystemTimeZones Condition="'$(FilterSystemTimeZones)' == ''">false</FilterSystemTimeZones>
3132
<EmccCmd>emcc</EmccCmd>
3233
<WasmObjDir>$(ArtifactsObjDir)wasm</WasmObjDir>

0 commit comments

Comments
 (0)