You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[RGen] Add two new validators one for arrays one for properties. (#23647)
Changes in this commit:
1. Added a generic array validator that will validate an array using an
inner validator.
2. Added a property validator that validates the following from a
property:
- Export<Property> attribute is valid.
- Must be declared partial.
- Supported platforms shoul be correct for the accessors.
- Validate each of the accessor selectors if they have been added.
Extra changes:
1. While test the property validator I found out that we were
duplicating errors in nested valiators. There is no need to add a new
strategy when adding a nested validator.
2. Updated some of the error messages in the FieldValidator since we got
one of the descriptors wrong.
3. Added a new string strategy to ensure that the number of ':' is a
selector matches the number of arguments in a method (this includes
getters and setters in properties).
/// Validates that a field property has the partial modifier.
53
-
/// </summary>
54
-
/// <param name="property">The property to validate.</param>
55
-
/// <param name="context">The root context for validation.</param>
56
-
/// <param name="diagnostics">When this method returns, contains an array of diagnostics if the property is invalid; otherwise, an empty array.</param>
57
-
/// <param name="location">The code location to be used for the diagnostics.</param>
58
-
/// <returns><c>true</c> if the property has the partial modifier; otherwise, <c>false</c>.</returns>
/// Validates that a field property has the static modifier.
65
-
/// </summary>
66
-
/// <param name="property">The property to validate.</param>
67
-
/// <param name="context">The root context for validation.</param>
68
-
/// <param name="diagnostics">When this method returns, contains an array of diagnostics if the property is invalid; otherwise, an empty array.</param>
69
-
/// <param name="location">The code location to be used for the diagnostics.</param>
70
-
/// <returns><c>true</c> if the property has the static modifier; otherwise, <c>false</c>.</returns>
/// Validates that the field property and its accessors are available on the current platform.
137
-
/// This method checks platform availability for the property itself, its getter (if present), and its setter (if present).
138
-
/// </summary>
139
-
/// <param name="property">The property to validate.</param>
140
-
/// <param name="context">The root context for validation.</param>
141
-
/// <param name="diagnostics">When this method returns, contains an array of diagnostics if the property or its accessors are not available on the current platform; otherwise, an empty array.</param>
142
-
/// <param name="location">The code location to be used for the diagnostics.</param>
143
-
/// <returns><c>true</c> if the property and all its accessors are available on the current platform; otherwise, <c>false</c>.</returns>
0 commit comments