blob: cc46b9777dbc30478b5488b2fbc6ee512bb525e9 [file] [log] [blame]
/*
* weinre is available under *either* the terms of the modified BSD license *or* the
* MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
*
* Copyright (c) 2010, 2011 IBM Corporation
*/
require ./Ex
//-----------------------------------------------------------------------------
class Binding(receiver, method)
if (receiver == null) throw new Ex(arguments, "receiver argument for Binding constructor was null")
if (typeof(method) == "string") method = receiver[method]
if (typeof(method) != "function") throw new Ex(arguments, "method argument didn't specify a function")
return function() {
return method.apply(receiver, [].slice.call(arguments))
}