Ok, It took me a lot longer to figure things out then I thought. Scala's compiler API is not for the faint hearted (nice work figuring this stuff out Alvaro).
I'm on my second attempt at refactoring the S2JS code base (for leaning purposes), becuase my first attempt was a disaster. I was just trying to walk through Alvaro's design, but things just got more complex than I was expecting (at least for my little brain).
Anyhow, after a break and having gained some knowledge of the API, I decided to tackle the problem from a different perspective. It's not in complete working order, nor do I have even close to the original feature set, but I think I've got a decent handle on how things work now. I've uploaded my attempt to the develop branch of my fork.
As a result of my experiment, I've ended up with some questions and thoughts.
First, why not use Scala's native trees as the bases for printing? I got really confused in the multiple transformations when all I really care about is writing javascript to a file. Scala's trees seem to be fairly easy to traverse, so I couldn't find any value in the additional JsTree layer. Please let me know if I'm missing something.
Second, is it a design goal to produce code that can be used in Closure specific projects? Personally, I don't think the Closure library will ever grow to mass adoption and many of it's components are poorly desinged and inconsistent accross the board. Having said that, I do like it best as a core library but producing idiomatic javascript + closure's dependency system with a compatibility to closure's library, might be a better goal.
AFAIK The Closure compiler does not do any optimizations for type information and the JsDoc system are clumbsy at best, so it would be nice to ignore a lot if not most of the type annotations and other such things. I do think producing JavaScript that can be optimized by the Closure compiler should be a main goal, but simply using the peuso-classical inheritence is will give us the most benefit.
Just some of my thoughts