On 5/28/15, 6:36 AM, "Michael Schmalle" <teotigraphix...@gmail.com> wrote:

>So Alex, you are saying try what Bable produces for get/set and make sure
>I
>make it swappable and not coupled in the emitter right?

I don’t really have a recommendation, just trying to find things in
common.  The code in org.apache.flex.utils.Language.superSetter and
superGetter are pretty close to what Babel showed.  Theirs might be more
robust or handle some edge case I haven’t hit yet.  I think the key
difference is how you find the super class.  It looks to me like
goog.inherit doesn’t use Object.create() and Object.getPrototypeOf.

IMO, you can definitely couple certain code gen to an emitter since we can
have multiple emitters.

>
>What are you doing for nested function scopes? Just creating local
>variables outside the function and referencing the current scope?

There is a local variable called “self” that is created if needed, and
lexical references in nested functions use ‘self.property' instead of
‘this.property’.  I think local scoping is the same in AS and JS.

In my mind, if it were me exploring Josh’s idea, I would have still
required Language.superSetter/superGetter and used goog.inherits and
goog.provide/require just to get something up quickly.  We’ll need an
emitter like this if we switch to writing all of the FlexJS JS in AS.  But
that’s probably because I know the current emitter.

-Alex

Reply via email to