flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: [FALCON] Convert MXMLPropertySpecifierNode to Binding
Date Fri, 27 Sep 2013 19:48:33 GMT
Yes, thanks for the tips.  I ended up changing code in FlexProject's
resolveProperty. The definitionSet at that point does contain the backing
var, getter and setter (I'll bet in MXMLC it doesn't contain the backing
var because it got an obfuscated name) so I changed the code to search the
entire set for a SetterDefinition but remember the other matching
definitions in case the SetterDefinition was not found.  I was not able to
get from a VariableDefinition back to a complete set in the DefinitionSet.
 Not sure why.

Then I've fixed two other bugs since then and am working on one more.  Who
knows how many there are after that.  As soon as I see the main screen of
this app show up I'll check in.


On 9/27/13 12:03 PM, "Gordon Smith" <gosmith@adobe.com> wrote:

>Did you make any progress on this?
>- Gordon
>-----Original Message-----
>From: Gordon Smith [mailto:gosmith@adobe.com]
>Sent: Thursday, September 26, 2013 2:28 PM
>To: dev@flex.apache.org
>Subject: Re: [FALCON] Convert MXMLPropertySpecifierNode to Binding
>OK, I understand now that in the SWC case these are read from the ABC as
>three independent definitions with no connections between them. I would
>expect that the Scope that contains the def for the backing variable also
>contains the getter/setter refs, as three definitions in a DefinitionSet
>for that definition name. Are you saying that the DefinitionSet has only
>one item? If so, you're going to have to read the ABC parsing code and
>figure out what is happening to the getter/setter.
>- Gordon
>On 9/26/13 2:18 PM, "Alex Harui" <aharui@adobe.com> wrote:
>>I'm trying to build a simpler test case so I can follow what's going on.
>>I've seen that the SyntheticBindableSetterDefinition gets created by
>>some analyzer run by the MXML and AS CompilationUnits.  But it doesn't
>>seem to get created by SWCCompilationUnits.  That sort of makes sense
>>to me because by then, the variable should have been converted to its
>>getter/setter pair and the backing variable.  But somehow, when the
>>MXMLPropertySpecifierNode is figuring out its definition it gets the
>>backing variable in the BindableNamespace instead of the setter.  I
>>tried getting all definitions that matched the name and it didn't
>>return anything other than the backing variable which was also puzzling.
>>On 9/26/13 2:09 PM, "Gordon Smith" <gosmith@adobe.com> wrote:
>>>I didn't work on Falcon's data bindingÅ  Bruce Frazer implemented
>>>what's there.
>>>If you can get the synthetic SetterDefinition then you can get its
>>>Name with getMName(). So find the code that synthesizes the
>>>getter/setter pair for a [Bindable] var, and make it store references
>>>to the getter and setter on the BindableVariableDefinition so that you
>>>can retrieve these synthetic definitions.
>>>- Gordon
>>>On 9/26/13 1:17 PM, "Alex Harui" <aharui@adobe.com> wrote:
>>>>getMName returns a Name with the same namespace as calling
>>>>getNamespaceReference() on the definition.
>>>>That still doesn't help me when the property is a [Bindable] var in a
>>>>class in a SWC. The definition is a VariableDefinition with the
>>>>BindableNamespace which represents the backing variable for the
>>>>[Bindable] code.    I somehow have to find a SetterDefinition and
>>>>out its namespace.
>>>>Any thoughts on that?
>>>>On 9/26/13 12:13 PM, "Gordon Smith" <gosmith@adobe.com> wrote:
>>>>>I was able to browse the Apache repo. getMName() is on
>>>>>DefinitionBase, but not on IDefinition. So try
>>>>>((DefinitionBase)propertyNode.getDefinition()).getMName() and see
>>>>>whether it returns the right kind of Name when the property is
>>>>>private or protected.
>>>>>- Gordon
>>>>>On 9/26/13 12:05 PM, "Gordon Smith" <gosmith@adobe.com> wrote:
>>>>>>I'm in a meeting in San Jose and don't have access to the Falcon
>>>>>>code at the moment. But I think Idefinition (or maybe only
>>>>>>DefinitionBase) has a
>>>>>>getMName() method that returns a Name.
>>>>>>- Gordon
>>>>>>On 9/26/13 11:37 AM, "Alex Harui" <aharui@adobe.com> wrote:
>>>>>>>It turns out that MXMLPropertySpecifierNode just calls its
>>>>>>>definition's getBaseName().  There doesn't seem to be any API
>>>>>>>IDefinition to return a fully qualified name.  I can get the
>>>>>>>INamespaceReference from the definition, but then how to I convert
>>>>>>>the INamespaceReference to a Namespace I can pass into Name?
>>>>>>>On 9/26/13 11:28 AM, "Gordon Smith" <gosmith@adobe.com>
>>>>>>>>I don't think using a Binding should be necessary. I think
>>>>>>>>bug is the
>>>>>>>>getName() of MXMLPropertySpecifierNode isn't returning the
>>>>>>>>kind of Name when the property is protected or private.
>>>>>>>>- Gordon
>>>>>>>>On 9/26/13 11:13 AM, "Alex Harui" <aharui@adobe.com>
>>>>>>>>>Darrell, Gordon (mostly),
>>>>>>>>>I'm having trouble with the codegen for a Binding destination
>>>>>>>>>have an MXMLPropertySpecifierNode for the property to
be set.
>>>>>>>>>This property can be protected or private as well as public.
>>>>>>>>>want to use the OP_setproperty instruction which seems
to take a
>>>>>>>>>Name.  However, the MXMLPropertySpecifierNode's getName()
>>>>>>>>>returns a Name that isn't qualified as protected or private.
>>>>>>>>>looking around, I see that other code that uses OP_setproperty
>>>>>>>>>seems to have a Binding and the getName() of that Binding
>>>>>>>>>I passed in the LexicalScope from the class and called
>>>>>>>>>getBinding on the MXMLPropertySpecifierNode's getDefinition()
>>>>>>>>>and that worked for protected and private members of the
>>>>>>>>>but what I'm seeing is that if the public variable is
>>>>>>>>>and comes from a class in a SWC then the
>>>>>>>>>MXMLPropertySpecifierNode has a VariableDefinition (instead
of a
>>>>>>>>>SynthesizedBindableSetterDefinition) and getBinding returns
>>>>>>>>>binding with the namespace set to the BindableNamespace
>>>>>>>>>of a public setter.
>>>>>>>>>I'm wondering if the MXMLPropertySpecifierNode's definition
>>>>>>>>>should be something other than a VariableDefinition when
>>>>>>>>>from a SWC, or the code should somehow special case that
>>>>>>>>>VariableDefinition and go hunting for a SetterDefinition,
>>>>>>>>>something else.

View raw message