Skip to content
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

Tighten types related to element attribute modification. #10091

Merged
merged 1 commit into from
Jun 22, 2017

Conversation

cramforce
Copy link
Member

Part of #9876

@cramforce
Copy link
Member Author

@wassgha Please review :)

@wassgha
Copy link
Contributor

wassgha commented Jun 22, 2017

@cramforce Sorry, notification slipped by, will review now!

Copy link
Contributor

@wassgha wassgha left a comment

Choose a reason for hiding this comment

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

Just revise getAttributesFromConfigObj, LGTM.

*/
export function getAttributesFromConfigObj(configObj) {
if (!configObj['attributes']) {
return {};
return dict();
}
if (!isObject(configObj['attributes']) || isArray(configObj['attributes'])) {
Copy link
Contributor

@wassgha wassgha Jun 22, 2017

Choose a reason for hiding this comment

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

Is this still enough to qualify for JsonObject? Also, might need to change the warning text.

Copy link
Member Author

Choose a reason for hiding this comment

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

Since this is a not, it is actually sound. Unfortunately it is essentially impossible to detect the correct type at runtime. We do have cases that definitely get it now.
My changes for now, try to limit themselves to cases that the type system can detect.

@cramforce cramforce merged commit 30c362f into ampproject:master Jun 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants