mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 03:21:20 -05:00
refactored and added a test for a8da321
This commit is contained in:
15
lib/nodes.js
15
lib/nodes.js
@@ -196,13 +196,14 @@
|
||||
return this.expressions.length === 0;
|
||||
};
|
||||
Expressions.prototype.makeReturn = function() {
|
||||
var end, idx;
|
||||
idx = this.expressions.length;
|
||||
while ((end = this.expressions[--idx]) instanceof Comment) {
|
||||
|
||||
}
|
||||
if (end) {
|
||||
this.expressions[idx] = end.makeReturn();
|
||||
var _ref2, end, idx;
|
||||
_ref2 = this.expressions;
|
||||
for (idx = _ref2.length - 1; idx >= 0; idx--) {
|
||||
end = _ref2[idx];
|
||||
if (!(end instanceof Comment)) {
|
||||
this.expressions[idx] = end.makeReturn();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user