We started using errorception on our website to track down errors that happen in the wild, and I am giving named anonymous functions a go (
http://kangax.github.io/nfe/)
Basically the goal is to have useful stack traces and give names to anonymous functions/callbacks like so:
// anonymous function/callback with no name
$('#some_element').on('click', function(e) {
// do something
});
// give the anonymous function/callback a name that appears in the stack trace
$('#some_element').on('click', function _name_to_appear_in_st(e) {
// do something
});
So I am trying to keep the name (in this example "
_name_to_appear_in_st") of the anonymous function in the minified code. I am using grunt/uglify, and tried passing mangle: false to the options, but the names aren't there. Is there a best way to go about this?
Thanks,
-Steve