Skip to content

Instantly share code, notes, and snippets.

@teramako
Created November 6, 2012 14:13
Show Gist options
  • Save teramako/4024949 to your computer and use it in GitHub Desktop.
Save teramako/4024949 to your computer and use it in GitHub Desktop.
[デバッグ用]Function.prototype.bind を修正して source プロパティに元関数を仕込む
/**
* debaggable bind
* set the original function to 'source' property on bind()
*/
(function(){
var bind = Function.prototype.bind;
Function.prototype.bind = function () {
var bound = bind.apply(this, arguments);
bound.source = this.source || this;
return bound;
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment