mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
Altered bound functions with do to just use call(this) rather than binding.
This commit is contained in:
@@ -108,7 +108,7 @@
|
||||
],
|
||||
Do: [
|
||||
o("DO Code", function() {
|
||||
return new Call($2, $2.params);
|
||||
return $2["do"]();
|
||||
})
|
||||
],
|
||||
Code: [
|
||||
|
||||
@@ -1048,6 +1048,14 @@
|
||||
Code.prototype.traverseChildren = function(crossScope, func) {
|
||||
return crossScope ? Code.__super__.traverseChildren.call(this, crossScope, func) : undefined;
|
||||
};
|
||||
Code.prototype["do"] = function() {
|
||||
if (this.bound) {
|
||||
this.bound = false;
|
||||
return new Call(new Value(this, [new Accessor(new Literal('call'))]), [new Literal('this')].concat(this.params));
|
||||
} else {
|
||||
return new Call(this, this.params);
|
||||
}
|
||||
};
|
||||
return Code;
|
||||
})();
|
||||
exports.Param = (function() {
|
||||
|
||||
Reference in New Issue
Block a user