-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[browser] Use DynamicDependencyAttribute contructor friendly to Inter…
…nalsVisibleTo when registering JSExports (#103402)
- Loading branch information
Showing
7 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...es/System.Runtime.InteropServices.JavaScript/tests/JavaScriptLibrary/JavaScriptInterop.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices.JavaScript; | ||
|
||
namespace JavaScriptLibrary; | ||
|
||
public partial class JavaScriptInterop | ||
{ | ||
[JSExport] | ||
public static int ExportedMethod(int a, int b) => a + b; | ||
|
||
internal static int ValidationMethod(int a, int b) => a + b; | ||
} |
26 changes: 26 additions & 0 deletions
26
...ystem.Runtime.InteropServices.JavaScript/tests/JavaScriptLibrary/JavaScriptLibrary.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<TargetFrameworks>$(NetCoreAppCurrent)-browser</TargetFrameworks> | ||
<!-- Use following lines to write the generated files to disk. --> | ||
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> | ||
</PropertyGroup> | ||
<!-- Make debugging easier --> | ||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'"> | ||
<WasmNativeDebugSymbols>true</WasmNativeDebugSymbols> | ||
<WasmNativeStrip>false</WasmNativeStrip> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildThisFileDirectory)JavaScriptInterop.cs" /> | ||
<InternalsVisibleTo Include="System.Runtime.InteropServices.JavaScript.Tests" /> | ||
<ProjectReference Include="$(CoreLibProject)" /> | ||
<ProjectReference Include="$(LibrariesProjectRoot)System.Private.Uri\src\System.Private.Uri.csproj" PrivateAssets="all" /> | ||
<ProjectReference Include="$(LibrariesProjectRoot)System.Collections\src\System.Collections.csproj" /> | ||
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\src\System.Runtime.csproj" /> | ||
<ProjectReference Include="$(LibrariesProjectRoot)System.Memory\src\System.Memory.csproj" /> | ||
<ProjectReference Include="$(LibrariesProjectRoot)System.Threading\src\System.Threading.csproj" /> | ||
<ProjectReference Include="$(LibrariesProjectRoot)System.Threading.Thread\src\System.Threading.Thread.csproj" /> | ||
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime.InteropServices.JavaScript\src\System.Runtime.InteropServices.JavaScript.csproj" SkipUseReferenceAssembly="true" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters