Skip to content

Commit 3b46605

Browse files
committed
Make JSRuntime.Current non-public
Fixes dotnet/aspnetcore#6828
1 parent 2410295 commit 3b46605

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/JSInterop/Microsoft.JSInterop/ref/Microsoft.JSInterop.netstandard2.0.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public static partial class Json
5252
}
5353
public static partial class JSRuntime
5454
{
55-
public static Microsoft.JSInterop.IJSRuntime Current { get { throw null; } }
5655
public static void SetCurrentJSRuntime(Microsoft.JSInterop.IJSRuntime instance) { }
5756
}
5857
public abstract partial class JSRuntimeBase : Microsoft.JSInterop.IJSRuntime

src/JSInterop/Microsoft.JSInterop/src/JSRuntime.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@ namespace Microsoft.JSInterop
1111
/// </summary>
1212
public static class JSRuntime
1313
{
14-
private static AsyncLocal<IJSRuntime> _currentJSRuntime
15-
= new AsyncLocal<IJSRuntime>();
14+
private static readonly AsyncLocal<IJSRuntime> _currentJSRuntime = new AsyncLocal<IJSRuntime>();
1615

17-
/// <summary>
18-
/// Gets the current <see cref="IJSRuntime"/>, if any.
19-
/// </summary>
20-
public static IJSRuntime Current => _currentJSRuntime.Value;
16+
internal static IJSRuntime Current => _currentJSRuntime.Value;
2117

2218
/// <summary>
2319
/// Sets the current JS runtime to the supplied instance.

0 commit comments

Comments
 (0)