Titanium JIRA Archive
Alloy (ALOY)

[ALOY-669] Generated style arrays sometimes contain "undefined" keys

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-05-24T14:06:33.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.2.0, 2013 Sprint 11
ComponentsStyling
Labelsn/a
ReporterTony Lukasavage
AssigneeTony Lukasavage
Created2013-05-23T21:28:50.000+0000
Updated2013-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.

Comments

  1. Tony Lukasavage 2013-05-24

    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.
  2. Federico Casali 2013-06-24

    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.

JSON Source