flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harbs <harbs.li...@gmail.com>
Subject Re: [FlexJS] more on undefined / non initialised values
Date Sun, 11 Jun 2017 08:21:43 GMT
It seems like the general case is better to have the initialization. Thanks for implementing
that.

It would probably be nice for the compiler to be intelligent and only initialize if the code
does not initialize too.

So:

var val:Boolean;
// further down before val is actually accessed
val = true;// or val = false;

should not initialize val, but:

var val:Boolean;
// further down 
if(val == someotherval){
// do something
}
should initialize it.

But I don’t see this as critical for now.

Harbs

> On Jun 11, 2017, at 10:56 AM, Justin Mclean <justin@classsoftware.com> wrote:
> 
> Hi,
> 
>> The changes you made look fine.
> 
> Do you want them as the default and an option to turn them off? I’m assuming you will
you at some later point add other switches to turn other optimisations (whatever they may
be) on?
> 
>> Seems like eventually we'll have to initialize other types as well.
> 
> I’d guestimate there would be a performance boost for string and for object as well
/ but the size cost may be different. Won't know until I or someone tries it.
> 
>> Safe, but inefficient at times.
> 
> So far I not seen any inefficiency in fact the opposite. But sure there may be specific
cases that perform better, please post any you find to the list.
> 
> Thanks,
> Justin


Mime
View raw message