3 ms·
We have a special on combinators this evening. Why not try a side order? function explicitize (fn) { return function () { return fn.apply(nul
by raganwald 13y ago
We have a special on combinators this evening. Why not try a side order?
function explicitize (fn) {
return function () {
return fn.apply(null, p(arguments, this));
}
}
Now you can write:
foo.prototype.bar = explicitize(function (myself, something, etc) {
// ...
}
- tracker1 13y agothat's pretty much what I meant by wrapped in a utility function... generally... something akin to explitize(ConstructorName, 'methodname') .. so that the passthrough call(s) can be shimmed/mocked for testing...