flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Mclean <jus...@classsoftware.com>
Subject Re: [FlexJS] more on undefined / non initialised values
Date Mon, 05 Jun 2017 21:46:05 GMT

> I believe in AS, there is no way to have
> 	if (b === false)
> Have any semantically different meaning than
>       if (b)

One will check for false the other true so they have opposite meaning. You'll also note I
stated “b == false” not “b === false”. 

Currently for an uninitialised variable b == false will equal true on AS but false on JS

> This latter pattern is fastest and smallest.  If we ever add optimizing to
> the compiler, it might the first pattern to the latter.

I hope not as it will produce a lot of errors.

You’ll also need to consider b == condition where the condition evaluates to false but b
is undefined, again you will get the result of true on AS and false on JS.

View raw message