mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
coco 02ee77c: nodes: fixed parenthesization in Op::compileNode
This commit is contained in:
@@ -1381,6 +1381,7 @@
|
||||
return ((_ref = this.operator) === '++' || _ref === '--' || _ref === 'delete') && unfoldSoak(o, this, 'first');
|
||||
};
|
||||
Op.prototype.compileNode = function(o) {
|
||||
var code;
|
||||
if (this.isUnary()) {
|
||||
return this.compileUnary(o);
|
||||
}
|
||||
@@ -1391,7 +1392,12 @@
|
||||
return this.compileExistence(o);
|
||||
}
|
||||
this.first.front = this.front;
|
||||
return "" + (this.first.compile(o, LEVEL_OP)) + " " + this.operator + " " + (this.second.compile(o, LEVEL_OP));
|
||||
code = this.first.compile(o, LEVEL_OP) + ' ' + this.operator + ' ' + this.second.compile(o, LEVEL_OP);
|
||||
if (o.level <= LEVEL_OP) {
|
||||
return code;
|
||||
} else {
|
||||
return "(" + code + ")";
|
||||
}
|
||||
};
|
||||
Op.prototype.compileChain = function(o) {
|
||||
var code, fst, shared, _ref;
|
||||
|
||||
Reference in New Issue
Block a user