Thanks for the links.  I believe that the Google Closure Library we use
sets up a particular pattern for inheritance.  I’m trying to figure out if
they have picked a pattern for defineProperty usage.  I only see a few
references in their code though.

When calling base classes using GCL inheritance, you are supposed to use
ThisClass.base(this, ‘functionName’, args).  It doesn’t look like
ThisClass.base would work on getters and setters.

The recommended pattern in the last link is pretty ugly:

  Object.getOwnPropertyDescriptor(ThisClass.base,
 ’setterName').set.call(this, args);


Maybe we want to make a function called super() that reduces this pattern
somehow.

Thoughts?
-Alex

On 1/30/15, 12:25 AM, "Harbs" <harbs.li...@gmail.com> wrote:

>Actually, this is probably a better link:
>http://stackoverflow.com/questions/12805777/how-can-i-call-getter-setter-i
>n-a-superclass-from-a-subclass
>
>On Jan 30, 2015, at 10:22 AM, Harbs <harbs.li...@gmail.com> wrote:
>
>> There’s a few ways to go about this. None of them straight-forward…
>> 
>> Here’s a nice write-up:
>> 
>>http://joshgertzen.com/object-oriented-super-class-method-calling-with-ja
>>vascript/
>> 
>> Here’s a discussion on Stack Overflow with some simple(ish) methods:
>> 
>>http://stackoverflow.com/questions/23077569/javascript-proper-way-to-call
>>-superclass-functions-from-subclass
>> 
>> On Jan 30, 2015, at 9:23 AM, Alex Harui <aha...@adobe.com> wrote:
>> 
>>> I’m starting in on this.  I’m unclear how you access the superclass’s
>>> getter or setter.  Anybody know?
>>> 
>>> ActionScript:
>>> function set foo(value:int):void
>>> {
>>> if (value != super.foo)
>>>   super.foo = value;
>>> }
>>> 
>>> Thanks,
>>> -Alex
>>> 
>>> On 1/19/15, 12:49 PM, "Erik de Bruin" <e...@ixsoftware.nl> wrote:
>>> 
>>>> Actually, JSGoogEmitter.java still has code to emit that method, so,
>>>> "simply" removing the override in FlexJS should get you started ;-)
>>>> 
>>>> EdB
>>>> 
>>>> 
>>>> 
>>>> On Mon, Jan 19, 2015 at 8:52 PM, Erik de Bruin <e...@ixsoftware.nl>
>>>>wrote:
>>>>> Definitely!
>>>>> 
>>>>> Edb
>>>>> 
>>>>> 
>>>>> 
>>>>> On Monday, January 19, 2015, Alex Harui <aha...@adobe.com> wrote:
>>>>>> 
>>>>>> I think we’ve agreed that IE9 is now the oldest browser that FlexJS
>>>>>> will
>>>>>> support in terms of JS output.  The original motivation was to get
>>>>>> enough
>>>>>> SVG support to do the graphics/skinning.  Folks needing to run
>>>>>> something
>>>>>> on older browsers can deploy the SWF version since those old
>>>>>>browsers
>>>>>> probably have Flash.
>>>>>> 
>>>>>> If we’re going to make IE9 the baseline, should we start using
>>>>>> Object.defineProperty instead of set_ and get_ functions?
>>>>>> 
>>>>>> -Alex
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Ix Multimedia Software
>>>>> 
>>>>> Jan Luykenstraat 27
>>>>> 3521 VB Utrecht
>>>>> 
>>>>> T. 06-51952295
>>>>> I. www.ixsoftware.nl
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> Ix Multimedia Software
>>>> 
>>>> Jan Luykenstraat 27
>>>> 3521 VB Utrecht
>>>> 
>>>> T. 06-51952295
>>>> I. www.ixsoftware.nl
>>> 
>> 
>

Reply via email to