Make JSRuntime.Current non-public (dotnet/extensions#1118)
Fixes https://github.com/aspnet/AspNetCore/issues/6828\n\nCommit migrated from c1d8be8b98
This commit is contained in:
parent
491cbdd119
commit
a4cd6152b6
|
|
@ -52,7 +52,6 @@ namespace Microsoft.JSInterop
|
|||
}
|
||||
public static partial class JSRuntime
|
||||
{
|
||||
public static Microsoft.JSInterop.IJSRuntime Current { get { throw null; } }
|
||||
public static void SetCurrentJSRuntime(Microsoft.JSInterop.IJSRuntime instance) { }
|
||||
}
|
||||
public abstract partial class JSRuntimeBase : Microsoft.JSInterop.IJSRuntime
|
||||
|
|
|
|||
|
|
@ -11,13 +11,9 @@ namespace Microsoft.JSInterop
|
|||
/// </summary>
|
||||
public static class JSRuntime
|
||||
{
|
||||
private static AsyncLocal<IJSRuntime> _currentJSRuntime
|
||||
= new AsyncLocal<IJSRuntime>();
|
||||
private static readonly AsyncLocal<IJSRuntime> _currentJSRuntime = new AsyncLocal<IJSRuntime>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current <see cref="IJSRuntime"/>, if any.
|
||||
/// </summary>
|
||||
public static IJSRuntime Current => _currentJSRuntime.Value;
|
||||
internal static IJSRuntime Current => _currentJSRuntime.Value;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the current JS runtime to the supplied instance.
|
||||
|
|
|
|||
Loading…
Reference in New Issue