3 ms·
As a source-to-source language, we try to keep debugging sane by outputting pretty-printed JavaScript that shouldn't be too hard to debug. For example, dropping
by jashkenas 16y ago
As a source-to-source language, we try to keep debugging sane by outputting pretty-printed JavaScript that shouldn't be too hard to debug. For example, dropping you right into the middle of the JavaScript that's generated for the CoffeeScript Lexer looks like this:
http://github.com/jashkenas/coffee-script/blob/master/lib/lexer.js#L130 http://github.com/jashkenas/coffee-script/blob/master/lib/le...
Pretty readable. You can use a Webkit or Firebug debugger just as you would with normal JS. It's a golden rule (with one small exception) that there are no CoffeeScript-specific constructs or special functions added to the runtime, no matter how tempting it might be to do so.
The single largest headache in practice is having to refer to the generated JS if the exception is vague, and just includes a line number. But I'm not sure that there's anything we can do to mitigate that, other than to keep the JS readable...