| |
| /* |
| * 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 |
| */ |
| |
| requireClass ./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)) |
| } |