Use boundMethod to bind all methods on the target.prototype
17223
function boundClass(target) {
    // (Using reflect to get all keys including symbols)
    let keys
    // Use Reflect if exists
    if (typeof Reflect !== 'undefined' && typeof Reflect.ownKeys === 'function') {
        keys = Reflect.ownKeys(target.prototype)
    } else {
        keys = Object.getOwnPropertyNames(target.prototype)
        // use symbols if support is provided
        if (typeof Object.getOwnPropertySymbols === 'function') {
            keys = keys.concat(Object.getOwnPropertySymbols(target.prototype))
        }
    }

    keys.forEach(key => {
        // Ignore special case target method
        if (key === 'constructor') {
            return
        }

        let descriptor = Object.getOwnPropertyDescriptor(target.prototype, key)

        // Only methods need binding
        if (typeof descriptor.value === 'function') {
            Object.defineProperty(target.prototype, key, boundMethod(target, key, descriptor))
        }
    })
    return target
}
837116
function() {
    var key = Array.prototype.shift.call(arguments);
    if (typeof Modifiers[key] != 'function') return Modifiers.error.call(this, {reason: 'no method', val: key});
    var ob = arguments[0];
    if (Modifiers.mappers[key] instanceof Array && (ob == null || (typeof ob != 'object') || (ob.constructor != Object))) {
      var context = {};
      Array.prototype.forEach.call(arguments, function(v, k) {
        var arg = Modifiers.mappers[key][k];
        if (arg) context[arg] = v;
      });
      return Modifiers[key].bind(context);
    }

    return Modifiers[key].bind(arguments[0] || {});
  }
1287039
function wrapObject(object, methods) {
      if (!(methods instanceof Array)) methods = Array.prototype.slice.call(arguments, 1);
      methods.forEach(function (method) {
        object[method] = wrap(object[method]);
      });
    }
1326003
function customizeMethods(custom) {
  _.each(custom, function(classMethods, className) {
    _.extend(xml2js.CLASSES[className].methods, _.pick(classMethods, function(methodSpec, methodName) {
      return isValidMethodSpec(methodSpec, className + '.' + methodName);
    }));
  });
}
370583
function logMethod (name, method) {
  var result = function () {
    var args = Array.prototype.slice.call(arguments);
    var event = {
      name: name,
      args: args
    };
    return when.try(function () {
      indentation++;
      event.state = 'Start';
      event.indentation = indentation;
      this._logMethodCall(event);
      return method.apply(this, args);
    }.bind(this), function (res) {
      indentation--;
      event.state = 'End';
      event.result = res;
      this._logMethodCall(event);
      return res;
    }.bind(this), function (err) {
      indentation--;
      event.state = 'Err';
      event.error = err;
      this._logMethodCall(event);
      throw err;
    }.bind(this));
  };

  result.logging = true;

  return result;
}
132368
function bindMethods(obj, scope) {
  return Object.keys(obj).reduce((bound, key) => {
    if (typeof obj[key] === 'function') {
      bound[key] = obj[key].bind(scope);
    } else if (_lodash2.default.isObject(obj[key])) {
      bound[key] = bindMethods(obj[key], scope);
    }
    return bound;
  }, {});
}
1265616
private static <T, G extends T> void generateDrawMethods(DexMaker dexMaker,
                                                             TypeId<G> generatedType,
                                                             TypeId<T> baseType) {
        generateDrawMethod(dexMaker, generatedType, baseType, ViewMethod.DRAW);
        generateDrawMethod(dexMaker, generatedType, baseType, ViewMethod.ON_DRAW);
    }
158486
private void updateBind(Node n) {
    CodingConvention.Bind bind =
        compiler.getCodingConvention().describeFunctionBind(n, false, true);
    if (bind == null) {
      return;
    }

    Node target = bind.target;
    FunctionType callTargetFn = getJSType(target)
        .restrictByNotNullOrUndefined().toMaybeFunctionType();
    if (callTargetFn == null) {
      return;
    }

    if (bind.thisValue != null && target.isFunction()) {
      JSType thisType = getJSType(bind.thisValue);
      if (thisType.toObjectType() != null && !thisType.isUnknownType()
          && callTargetFn.getTypeOfThis().isUnknownType()) {
        callTargetFn =
            FunctionType.builder(registry)
                .copyFromOtherFunction(callTargetFn)
                .withTypeOfThis(thisType.toObjectType())
                .build();
        target.setJSType(callTargetFn);
      }
    }

    n.setJSType(
        callTargetFn.getBindReturnType(
            // getBindReturnType expects the 'this' argument to be included.
            bind.getBoundParameterCount() + 1));
  }
783981
function() {
		var args = Array.prototype.slice.call(arguments);
		args.unshift(null);
		var Factory = classFunc.bind.apply(
			classFunc,
			args
		);
		this._inst = new Factory();
	}
182685
def bound_method(block)
      type = self.type
      arity = block.arity
      arity += 1 if arity >= 0 # Make sure the object gets passed
      arity += 1 if arity == 1 && type == :around # Make sure the block gets passed

      method = lambda { |object, *args| object.instance_exec(*args, &block) }


      # Proxy arity to the original block
      (
      class << method;
        self;
      end).class_eval do
        define_method(:arity) { arity }
      end

      method
    end
992189
def _make_bound_method(func, self):
    """"""
    class Foo(object):
        def meth(self): pass
    f = Foo()
    bound_method = type(f.meth)
    try:
        return bound_method(func, self, self.__class__)
    except TypeError: # python3
        return bound_method(func, self)
1267402
function() {
			var Klass = this;
			if(Klass.autoBind){
				var $autobound = $(Klass.autoBind);
				/* Bind existing elements */
				$autobound.each(function(){
					Klass.attach($(this));
				});
				/* If a click propagates to the document level, then we have an item that was added later on */
				$(document).on('click', Klass.autoBind, function(evt) {
					if (evt.isDefaultPrevented()) {
						return;
					}
					var $cur = $(evt.currentTarget);
					var len = $autobound.length;
					$autobound = $autobound.add($cur);
					if(len === $autobound.length) {
						return; /* already bound */
					}
					/* Bind featherlight */
					var data = Klass.attach($cur);
					/* Dispatch event directly */
					if (!data.filter || $(evt.target).parentsUntil($cur, data.filter).length > 0) {
						data.handler(evt);
					}
				});
			}
		}
769089
function(methodName) {
                    var origMethod = that[methodName],
                        ret;

                    that[methodName] = function() {
                        args = _simplifyArray(Array.prototype.slice.call(arguments, 0));
                        ret = origMethod.apply(that, arguments);
           
                        that._trace({
                            method: methodName,
                            args: args
                        });
                 
                        return ret;
                    };
            }
211651
function prototypeMethodOrNull(className, method) {
  var ctor = goog.global[className];
  return (ctor && ctor.prototype && ctor.prototype[method]) || null;
}
669868
function doBindForMethod (signature) {
    // validate signature
    signature = getValidSignature(signature)
    // if method is not defined do nothing
    if (!hasMethod(signature.signature)) {
        return
    }
    // get method and module
    var method = getMethod(signature.signature)
    var module = getModule(signature.moduleName)
    // skip if no binds for module
    if (!defined(immutable.binds[signature.moduleName])) {
        return
    }
    // skip if no binds for method
    if (!defined(immutable.binds[signature.moduleName][signature.methodName])) {
        return
    }
    // get all binds for method indexed by bind method
    var bindTypeBinds = immutable.binds[signature.moduleName][signature.methodName]
    // iterate over each bind method
    _.each(bindTypeBinds, (boundMethods, bindType) => {
        // iterate over each bind
        _.each(boundMethods, boundMethod => {
            // do nothing if already bound
            if (boundMethod.bound) {
                return
            }
            // bind method
            module.bind(bindType, signature.methodName, boundMethod.method)
            // set bound flag
            boundMethod.bound = true
        })
    })
}
1291701
public Object invokeMethod(String name, Object args) {
        try {
            return super.invokeMethod(name, args);
        }
        // if the method was not found in the current scope (the script's methods)
        // let's try to see if there's a method closure with the same name in the binding
        catch (MissingMethodException mme) {
            try {
                if (name.equals(mme.getMethod())) {
                    Object boundClosure = getProperty(name);
                    if (boundClosure != null && boundClosure instanceof Closure) {
                        return ((Closure) boundClosure).call((Object[])args);
                    } else {
                        throw mme;
                    }
                } else {
                    throw mme;
                }
            } catch (MissingPropertyException mpe) {
                throw mme;
            }
        }
    }
1088979
function bind( fn, scope ) {
    var bound, args;
    if ( fn.bind === nativeBind && nativeBind ) return nativeBind.apply( fn, Array.prototype.slice.call( arguments, 1 ) );
    args = Array.prototype.slice.call( arguments, 2 );
    // @todo: don't link this
    bound = function() {
        if ( !(this instanceof bound) ) return fn.apply( scope, args.concat( Array.prototype.slice.call( arguments ) ) );
        W.ctor.prototype = fn.prototype;
        var self = new ctor();
        var result = fn.apply( self, args.concat( Array.prototype.slice.call( arguments ) ) );
        if ( Object( result ) === result ) return result;
        return self;
    };
    return bound;
}