For me falcon should add logic to resolve "isVertical" to the instance function in order to be backward-compatible with MXMLC as this. is omitted a lot in AS3 code currently. This would be a lot to fix if all the projects throw an error where code like this is used.
On Mon, Aug 22, 2016 at 7:38 AM, Alex Harui <aha...@adobe.com> wrote: > Hi, > > While debugging why some code in the MX/Spark for FlexJS wasn't working, I > saw something like this: > > private function isVertical():Boolean > { > ... > } > > Public function measure():void > { > var isVertical:Boolean = isVertical(); > } > > MXMLC seems to be ok with this. For Falcon, the resolver finds the local > variable (which I think it should) and generates a call to that local > variable which isn't even of type Function, and an exception is thrown at > runtime. No compiler error is reported. > > MXMLC not only doesn't generate an error, it seems to generate a function > call to isVertical() by getting the instance "isVertical". IOW, MXMLC > seems to think the above code is equivalent to: > > public function measure():void > { > var isVertical:Boolean = this.isVertical(); > } > > It seems to me that Falcon is correct. AIUI, local variables should mask > instance variables and require you to use "this." to access the instance > version. > > > So the questions are: > -Should Falcon add logic to resolve "isVertical" to the instance function > in order to be backward-compatible with MXMLC? > -Should Falcon generate an error if there is an attempt to make a function > call on a variable that isn't of type Function, Object or *? > -Should I fix the code in the SDK to add "this." to isVertical()? > -is there supposed to be an exception in resolving for Function calls? > > Thanks, > -Alex > >