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

[ALOY-1355] Fixed issue where attributes containing 'true' or 'false'… #756

Merged
merged 2 commits into from
Feb 16, 2016

Conversation

cb1kenobi
Copy link
Contributor

… where being treated as strings instead of booleans. There's no way for Alloy to know if the attribute really is a boolean or not, so we have to blindly test for 'true' and 'false'. This isn't ideal. If someone has a label of 'true', then it will be cast as a bool, but should be cast back to a string when used in the context of a string value.

… where being treated as strings instead of booleans. There's no way for Alloy to know if the attribute really is a boolean or not, so we have to blindly test for 'true' and 'false'. This isn't ideal. If someone has a label of 'true', then it will be cast as a bool, but *should* be cast back to a string when used in the context of a string value.
@FokkeZB
Copy link
Contributor

FokkeZB commented Feb 12, 2016

Actually, same is true for numbers. I you do <TabbedBar index=0> it will be a "0" string currently, while it should clearly be a 0 Number.

@cb1kenobi could you update the PR so it also handles that? Then it resolves https://jira.appcelerator.org/browse/ALOY-1324 as well (which talks about both boolean and number). I have no idea if we can see if one uses <TabbedBar index=0> or <TabbedBar index="0"> in the XML but at least in the last case it should be a Number.

Perhaps we could even do the same with boolean? I've tested that <View visible=false> compiles OK. So if there's a way we can see quotes have been used then that would be a great way to know if we should cast the value. Then it wouldn't be a possible breaking change.

jindw/xmldom#156

@cb1kenobi
Copy link
Contributor Author

@FokkeZB Fixed. :)

@skypanther
Copy link
Contributor

Last I checked, if you used something like <View visible=false/> Alloy would output a warn in the logs. If that is going to be acceptable XML, the logging should be updated to accommodate it. Maybe that's from xmldom?

@feons
Copy link
Contributor

feons commented Feb 16, 2016

Looks good. Approved.

feons added a commit that referenced this pull request Feb 16, 2016
[ALOY-1355] Fixed issue where attributes containing 'true' or 'false'…
@feons feons merged commit 15bfba2 into tidev:master Feb 16, 2016
@cb1kenobi cb1kenobi deleted the aloy-1355 branch February 16, 2016 23:04
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.

None yet

4 participants