tj / callsite

node.js access to v8's "raw" CallSites -- useful for custom traces, c-style assertions, getting the line number in execution etc
MIT License
245 stars 11 forks source link

Doesn't seem to work for coffeescript #3

Closed wmertens closed 11 years ago

wmertens commented 11 years ago

better-assert tries to load the non-existent javascript file which it got from callsite instead of the coffeescript file which even has the correct line numbers thanks to source maps.

tj commented 11 years ago

nope

wmertens commented 11 years ago

Ok, I get that you don't like CoffeeScript, but perhaps you could give me some hints on what to change so I could make it work in a fork or something?

Basically callsite doesn't have to support CS per se, but just source maps in general. Is this something that is feasible?

tj commented 11 years ago

should be doable with source maps

wmertens commented 11 years ago

Ah. I dug around a bit and found https://github.com/michaelficarra/CoffeeScriptRedux/blob/master/src/run.coffee which is several times longer than callsite itself ;) Written in coffeescript but should be broadly applicable to any source maps.

A bit too involved for me to hack on right now. Commenting here in case anyone else feels up to it.