Maybe that's where source maps come handy?
http://www.html5rocks.com/en/tutorials/developertools/source...
http://www.html5rocks.com/en/tutorials/developertools/source...
The slightly overbearing complexity of the solution matches the linguistic complexity of the statement above :)
Process: C# --(compiler)--> Js --(parser)--> IL --(compiler)--> machine code/interpreter.
Type conversions: Static --> dynamic --> static --> none.
That's just too much to go wrong in my mind. I wouldn't touch it with a barge pole.