summaryrefslogtreecommitdiff
path: root/deps/node/deps/npm/node_modules/slide/lib/bind-actor.js
blob: 6a370727494a3d2c8a24d0b75c44394e85620fef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module.exports = bindActor
function bindActor () {
  var args = 
        Array.prototype.slice.call
        (arguments) // jswtf.
    , obj = null
    , fn
  if (typeof args[0] === "object") {
    obj = args.shift()
    fn = args.shift()
    if (typeof fn === "string")
      fn = obj[ fn ]
  } else fn = args.shift()
  return function (cb) {
    fn.apply(obj, args.concat(cb)) }
}