How can I access CoffeeScript to JS compiled vars in the Chrome Developer
Tools JavaScript Console?
I have a Rails app with a CoffeeScript file. The Rails Asset Pipeline
compiles it into a JavaScript file.
I'd like to open up the Chrome Developer Tools JavaScript Console and
execute functions defined in my .coffee file.
However in the compiled JS it's all wrapped up like this...
(function() {
var youLot = function() {
return "Wot?";
};
}).call(this);
So what happens in the JS console...
youLot();
ReferenceError: youLot is not defined
Without going through too many contortions, is there a way I can call
youLot() in the Chrome JS console even though I originally declared it in
a CoffeeScript file?
(BTW, why does the CoffeeScript compiler enclose it like that?)
No comments:
Post a Comment