摘要: var origDoSomething = Thing.prototype.doSomething;Thing.prototype.doSomething = function() { var start = Date.now(); var result = origDoSomething.apply(this, arguments); console.log((Date.now() - start) + 'ms', x, y, result); return result;} 阅读全文
posted @ 2013-12-10 17:27 sexy_girl 阅读(132) 评论(0) 推荐(0) 编辑
摘要: slice = Array.prototype.slice,// Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { if ( typeof context === "string" ) { var tmp = fn[ context ]; context = fn; fn = tmp; } // Quick... 阅读全文
posted @ 2013-12-10 16:46 sexy_girl 阅读(185) 评论(0) 推荐(0) 编辑