Skip to content

Instantly share code, notes, and snippets.

@jrburke
Created September 4, 2013 23:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrburke/6444081 to your computer and use it in GitHub Desktop.
Save jrburke/6444081 to your computer and use it in GitHub Desktop.
Crude tracer
// Optionally log all calls done to prototype methods. Uncomment this
// section to get traces when trying to debug where flow gets stuck.
Object.keys(Email.prototype).forEach(function(key) {
var desc = Object.getOwnPropertyDescriptor(Email.prototype, key);
if (!desc.get && !desc.set && typeof Email.prototype[key] === 'function') {
var oldMethod = Email.prototype[key];
Email.prototype[key] = function() {
var args = Array.prototype.slice.call(arguments, 0).map(function(arg) {
return String(arg);
}).join(', ');
console.log('Email.' + key + '(' + args + ')');
return oldMethod.apply(this, arguments);
};
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment