flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: [FlexJS] Text binding showing undefined
Date Thu, 16 Feb 2017 22:43:56 GMT

On 2/16/17, 2:34 PM, "Harbs" <harbs.lists@gmail.com> wrote:

>> Well, that's not PAYG (yes, I'm being picky).
>I disagree. For string it certainly is PAYG. There’s no extra cost. (and
>considering the three bytes of ‘=“”’ in the source code is getting petty

Pretty sure that uninitialized variables do not have any presence in
minified JS.  So every variable where you do this is adding

  foo.bar = "";

to the app.

> Adding an extra TextModelWithEmptyStringDefaults is totally unnecessary.
>> Again, what
>> percentage of the time in production will a label's text property not be
>> set to something other than “"?
>More than you’d think. We ran into this because we were using
>ImageAndTextButton without text. But it’s quite common to have components
>which get text or not at runtime.

Then use ImageButton.  Or swap in a different model with empty string
defaults for ImageAndTextButton.

For just one occurrence, you probably won't notice, But after we
initialize 100 or 1000 properties to "" you might notice.

My 2 cents,

View raw message