Alex I know it's late(I am doing major renovations this week so I am slow) but;
I ended up keeping a model in Randori for this type of stuff and knew I was in expressions so I could test right side and left appropriately etc. It's just there is a lot of code underneath these changes that might now be tested and I know from experience changing stuff quick at the expression level can almost 90% of the time have unintended side effects elsewhere. I also know that there are going to be issues that come up as more people use this with not so much edge cases but dusty parts of the emitter and AS language usage, like weird static to instance access among others. We just really need to be careful about how we change stuff like this and I agree coming back to the point, accessing parents is not a good idea. Why? Because there are so many parent combinations that you end up getting spaghetti code. :) Mike On Mon, Jun 29, 2015 at 10:59 AM, Alex Harui <aha...@adobe.com> wrote: > OK. I will work on it. I looked already and want to get your thoughts: > there are several places in the emitter where we stop and look up the > parent nodes to try to find the context. Is that a normal thing to do in > a compiler or should we be passing some sort of context down? In this > case, there is a variable node assigning a member access expression that > resolves to a member access function, but I can imagine really complex > scenarios where the member access expression isn’t the right-most leaf > node of the assigned value so it isn’t always right to look up the tree. > I’m tempted to add a flag that tells you that you are in the assigned > value and add a check for right-most leaf node. > > Thoughts? > -Alex > > On 6/29/15, 2:13 AM, "Michael Schmalle" <teotigraphix...@gmail.com> wrote: > > >Well, I was only trying to be nice but, if you know how to fix this sooner > >than later, do it. I have this next week or two left with very little > >time, > >more like just enough to send emails. > > > >Mike > > > >On Mon, Jun 29, 2015 at 1:13 AM, Alex Harui <aha...@adobe.com> wrote: > > > >> > >> > >> On 6/28/15, 2:21 PM, "Michael Schmalle" <teotigraphix...@gmail.com> > >>wrote: > >> > >> >On Sun, Jun 28, 2015 at 5:17 PM, Josh Tynjala <joshtynj...@gmail.com> > >> >wrote: > >> > > >> >> Yes, that is correct. > >> >> > >> >> In case it wasn't obvious, event listeners are the typical use case > >> >>where > >> >> you'd pass a reference to a member function somewhere else where a > >> >> reference needs to be saved in a variable. AS3 made this easy by > >> >> automatically binding member functions. JavaScript usually requires > >>some > >> >> manual intervention to get event listeners to be called with the > >>right > >> >> scope. > >> >> > >> > > >> >Yeah the compiler does this already for anonymous functions, it > >>creates a > >> >self var pointing to 'this' and then uses self in the anonymous > >>function's > >> >body. > >> > >> Actually, that ‘self’ stuff is for AS lexical scoping. Josh is more > >> interested in the use of goog.bind for function identifiers. FalconJX > >> handles that correctly in most cases for addEventListener and other > >> callbacks, but I guess we don’t handle this scenario. > >> > >> I can try to take a look at it, but if you want to, search for > >>GOOG_BIND. > >> > >> > > >> >I wasn't aware of this problem though, can you create a JIRA ticket? I > >> >probably will be the one that tackles it since I am sure Alex doesn't > >>have > >> >time to do something like this and test it as well. > >> > >> Well, I can probably get it working, but I’m sure I won’t test it as > >>well > >> as you will. > >> > >> -Alex > >> > >> > >