3 ms·
My favorite trick along those lines: var cache = SomeClass.prototype.someMethod; SomeClass.prototype.someMethod = function () { debugger; // or `throw
by GeneralMayhem 13y ago
My favorite trick along those lines:
var cache = SomeClass.prototype.someMethod;
SomeClass.prototype.someMethod = function () {
debugger; // or `throw "stacktrace"`
cache.apply(this, arguments)
}
Inserts a stack trace right in the middle of executing someone else's code, which is nice for tracking down why/when that function gets called if documentation is poor, without changing functionality.