这个问题与我的previous question有关,所以我将在这里添加几乎相同的代码 .
Ease.bezier = function(mX1, mY1, mX2, mY2) {
return _bezier.processBezier(mX1, mY1, mX2, mY2);
};
var _bezier = Ease.bezier.prototype;
_bezier.processBezier = function (mX1, mY1, mX2, mY2) {
return _bezier.render; // this is where I need the `this`, mX1, mY1, mX2, mY2 to be passed into the next function
};
_bezier.render = function(aX){ //the aX value here comes from another object
var mX1 = [bound function attributes[1]]; // I think you can understand what I mean here
if (mX1 === mY1 && mX2 === mY2) return aX;
if (aX === 0) return 0;
if (aX === 1) return 1;
return _bezier.computeBezier(_bezier.gx(aX), mY1, mY2);
};
现在我需要知道是否可以以某种方式绑定这两个函数,而不会影响来自另一个对象的 aX
值,并且可以访问第一个函数中的 this
和 mX1, mY1, mX2, mY2
参数 .
可能吗?我该怎么做?
1 回答
你可以像这样使用arguments对象吗?