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] refactor_sprite branch
Date Wed, 10 Aug 2016 22:41:40 GMT
OK, just pushed a fix for Namespace and Qname.

Scanning our generated JS code shows that many implicit coercions are
still being generated, but as far as I can tell they are all "correct".
We could do more "guessing" like assuming that
someArray[someIndex].substring() is really going to return a string.  What
do others think?

Otherwise, we should go fix up stuff like this by using
@flexjsignorecoercion String and writing:
   (someArray[someIndex] as String).substring()

It is a classic example of what kinds of things would be caught if we ever
create a "super-strict" mode that warns on every access of type "*" and/or
"Object".  It is easy to lose type-safety in ActionScript.

We could also use @flexjsnoimplicitstringconversion but there might be an
advantage to being more strict about types in our code, especially if you
take the time to use typed local variables instead of repeating the "as
String" on more than one line of code.  It might allow the JS runtime to
do more type inferencing and speed things up.


View raw message