removed extra parens from array/index compilations

This commit is contained in:
satyr
2010-10-21 06:00:52 +09:00
parent c11ca94870
commit 78835073db
5 changed files with 9 additions and 9 deletions

View File

@@ -188,9 +188,9 @@
};
Expressions.prototype.makeReturn = function() {
var end, idx;
end = this.expressions[(idx = this.expressions.length - 1)];
end = this.expressions[idx = this.expressions.length - 1];
if (end instanceof Comment) {
end = this.expressions[(idx -= 1)];
end = this.expressions[idx -= 1];
}
if (end && !(end instanceof Return)) {
this.expressions[idx] = end.makeReturn();
@@ -646,7 +646,7 @@
__extends(Index, Base);
Index.prototype.children = ['index'];
Index.prototype.compileNode = function(o) {
return "" + (this.proto ? '.prototype' : '') + "[" + (this.index.compile(o)) + "]";
return (this.proto ? '.prototype' : '') + ("[" + (this.index.compileBare(o)) + "]");
};
Index.prototype.isComplex = function() {
return this.index.isComplex();
@@ -849,7 +849,7 @@
objects = [];
for (i = 0, _len2 = (_ref3 = this.objects).length; i < _len2; i++) {
obj = _ref3[i];
code = obj.compile(o);
code = obj.compileBare(o);
objects.push(obj instanceof Comment ? "\n" + code + "\n" + (o.indent) : i === this.objects.length - 1 ? code : code + ', ');
}
objects = objects.join('');