mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 03:21:20 -05:00
fixed a bug where multiple trailing comments prevented returnification
This commit is contained in:
@@ -197,11 +197,11 @@
|
||||
};
|
||||
Expressions.prototype.makeReturn = function() {
|
||||
var end, idx;
|
||||
end = this.expressions[idx = this.expressions.length - 1];
|
||||
if (end instanceof Comment) {
|
||||
end = this.expressions[idx -= 1];
|
||||
idx = this.expressions.length;
|
||||
while ((end = this.expressions[--idx]) instanceof Comment) {
|
||||
|
||||
}
|
||||
if (end && !(end instanceof Return)) {
|
||||
if (end) {
|
||||
this.expressions[idx] = end.makeReturn();
|
||||
}
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user