On Thu, Dec 27, 2012 at 11:56 AM, Michael Schmalle
<apa...@teotigraphix.com>wrote:

> Also did a trick to allow a hook into the beginning of a function block to
> inject code. We can do that anywhere it's needed, I don't see a lot of
> situations like that though.


There is something quite similar in Jangaroo's JSCodeGenerator: you can
inject any CodeGenerator into a function, making it generate code at the
beginning of its body.
Another situation where I needed that was an aliased "this" reference (var
$this=this;) to be able to access it in inner anonymous functions. If it is
needed multiple times (i.e. by several anonymous functions), the alias
assignment is still generated only once.
-Frank-

Reply via email to