Skip to content

Validate one-off property sets #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 21, 2018
Merged

Validate one-off property sets #168

merged 2 commits into from
May 21, 2018

Conversation

kevmoo
Copy link
Collaborator

@kevmoo kevmoo commented May 21, 2018

Unlike ctor arguments, we can wrap the entire set of a class property. This allows us to get a the JSON key, even if the error thrown is not an ArgumentError.

@kevmoo kevmoo requested a review from jakemac53 May 21, 2018 17:59
@@ -237,8 +237,7 @@ Matcher _getMatcher(bool checked, String expectedKey, bool checkedAssignment) {

if (checked) {
if (checkedAssignment &&
const ['intIterable', 'datetime-iterable', 'validatedPropertyNo42']
.contains(expectedKey)) {
const ['intIterable', 'datetime-iterable'].contains(expectedKey)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakemac53 – this is where the rubber hits the road. Now the expected key for validatedPropertyNo42 is not null

'${_element.displayName} ${_prefix}FromJson($mapType json) =>'
'\$checkedNew($classLiteral, json, ()');

var data = writeConstructorInvocation(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be moved back outside the if? I don't see what is different in the two branches.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@kevmoo kevmoo merged commit a83e3d7 into master May 21, 2018
@kevmoo kevmoo deleted the more_checked branch May 21, 2018 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants