[ALOY-669] Generated style arrays sometimes contain "undefined" keys
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-05-24T14:06:33.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.2.0, 2013 Sprint 11 |
Components | Styling |
Labels | n/a |
Reporter | Tony Lukasavage |
Assignee | Tony Lukasavage |
Created | 2013-05-23T21:28:50.000+0000 |
Updated | 2013-06-24T13:34:51.000+0000 |
Description
When printing out a simple generated style array it sometimes contains entries that have "undefined" key entries, making them useless. For example, this is the JSON.stringify() version of the index style from the [basics/simple|] test app:
[ {
isApi: true,
priority: 1000.0003,
key: "Label",
style: {
color: "#000",
font: {
fontSize: "18dp",
fontWeight: "bold"
},
height: "__ALLOY_EXPR__--Ti.UI.SIZE",
width: "__ALLOY_EXPR__--Ti.UI.SIZE"
}
}, {
isApi: true,
priority: 1000.0004,
key: "undefined"
}, {
isId: true,
priority: 100000.0002,
key: "index",
style: {
backgroundColor: "#fff",
fullscreen: false,
exitOnClose: true
}
} ];
This has not been an issue to this point because these values were simply unused in the compile process. Now that styles are going to be used at runtime (ALOY-210), they need to be as efficient as possible, which involved removing these useless entries.
PR: https://github.com/appcelerator/alloy/pull/134 Testing to confirm that this bug is resolved can be done simply by running
jake test:all
, as part of the PR includes augmenting the compile testing to search the generated styles for invalid undefined style entries. If all those unit tests pass, then the bug is resolved.Verified as fixed. Titanium SDK 3.1.2.v20130619101604 Alloy 1.2.0 Appcelerator Studio 3.1.1.201306131423 Android 4.2.2 and iOS 6 devices. Closing.