For my prototype work I have been using a C# to JS compiler called SharpiKit.
It might be useful to look at how they are generating code as it works pretty damn well. Also, their output is easily captured by the closure compiler and made even more optimal. It is not perfect but has about the best feature set of any project of this nature I have seen. Mike