Skip to content

Validate one-off property sets#168

Merged
kevmoo merged 2 commits into
masterfrom
more_checked
May 21, 2018
Merged

Validate one-off property sets#168
kevmoo merged 2 commits into
masterfrom
more_checked

Conversation

@kevmoo

@kevmoo kevmoo commented May 21, 2018

Copy link
Copy Markdown
Collaborator

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
if (checkedAssignment &&
const ['intIterable', 'datetime-iterable', 'validatedPropertyNo42']
.contains(expectedKey)) {
const ['intIterable', 'datetime-iterable'].contains(expectedKey)) {

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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