refactored and added a test for a8da321

This commit is contained in:
satyr
2010-10-23 02:59:25 +09:00
parent a8da321883
commit 1130f4fef5
3 changed files with 18 additions and 11 deletions

View File

@@ -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;
};