Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
doowb committed Oct 12, 2015
1 parent 2dca40d commit 2e0b2be
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,14 @@ utils.defaults = function(target) {
return target;
};

utils.forward = function (options) {
var fromObj = options.fromObj;
var toObj = options.toObj;
var fromMethod = options.fromMethod;
var toMethod = options.toMethod;

toObj.define(toMethod, {
utils.forward = function (opts) {
var from = opts.fromObj;
var to = opts.toObj;
to.define(opts.toMethod, {
configurable: true,
get: function () {
var fn = fromObj[fromMethod].bind(fromObj);
fn.__proto__ = fromObj;
var fn = from[opts.fromMethod].bind(from);
fn.__proto__ = from;
return fn;
}
});
Expand Down

0 comments on commit 2e0b2be

Please sign in to comment.