-
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.
[wasm][debugger] Remove
JToken
properties that are for internal use…
… only (#75958) * Keep underscore removable properties as constants. * Clean up before exposing externally. * Value types need cleanup as well. * Fixed RootHidden tests. * Applied a variation of @radical's idea. * Fix tests. * Reverted to @radical's version. * Revert 14a2be2. * Applied radical's suggestions.
- Loading branch information
1 parent
31d4e3a
commit acb4564
Showing
7 changed files
with
129 additions
and
49 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
src/mono/wasm/debugger/BrowserDebugProxy/Common/InternalUseFieldName.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,38 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
#nullable enable | ||
|
||
using System.Collections.Generic; | ||
|
||
namespace Microsoft.WebAssembly.Diagnostics; | ||
|
||
internal sealed class InternalUseFieldName | ||
{ | ||
public static InternalUseFieldName Hidden = new(nameof(Hidden)); | ||
public static InternalUseFieldName State = new(nameof(State)); | ||
public static InternalUseFieldName Section = new(nameof(Section)); | ||
public static InternalUseFieldName Owner = new(nameof(Owner)); | ||
public static InternalUseFieldName IsStatic = new(nameof(IsStatic)); | ||
public static InternalUseFieldName IsNewSlot = new(nameof(IsNewSlot)); | ||
public static InternalUseFieldName IsBackingField = new(nameof(IsBackingField)); | ||
public static InternalUseFieldName ParentTypeId = new(nameof(ParentTypeId)); | ||
|
||
private static readonly HashSet<string> s_names = new() | ||
{ | ||
Hidden.Name, | ||
State.Name, | ||
Section.Name, | ||
Owner.Name, | ||
IsStatic.Name, | ||
IsNewSlot.Name, | ||
IsBackingField.Name, | ||
ParentTypeId.Name | ||
}; | ||
|
||
private InternalUseFieldName(string fieldName) => Name = $"__{fieldName}__"; | ||
|
||
public static int Count => s_names.Count; | ||
public static bool IsKnown(string name) => !string.IsNullOrEmpty(name) && s_names.Contains(name); | ||
public string Name { get; init; } | ||
} |
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
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
Oops, something went wrong.