简体   繁体   中英

How can I browse to javascript compiled via the coffeescript tag?

For development, I'm using coffee-script.js and the coffeescript tag to dynamically compile my coffeescript in the browser. This works great, except that I can't navigate to the compiled javascript from the browser (this is Chrome and Firefox/Firebug). If I explicitly add a debugger call, or set the browser to breakpoint on an exception, it drops me into the compiled javascript just fine, but that seems to be the only way to get at it.

My current technique is to add

setTimeout () -> throw "debug me!"

so the code will throw an exception (within a timeout handler, so it doesn't break out of any shared execution stack), which I can choose to breakpoint or not.

If I breakpoint, it drops me into a source tab called (program) :

Chrome调试窗口

but this isn't any of the (program) entries in the list on the left panel, and if I close this tab I have no way of getting back to it.

Is there any other way to get to this compiled code?

You can insert debugger in your code, it'll be interpretted as a breakpoint in most browsers.

I use js2coffee.org to get fast preview of my js from coffeescript (just paste it in the coffee to js panel)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM