Issue #1703, - --x

This commit is contained in:
Jeremy Ashkenas
2011-09-17 22:21:47 -04:00
parent 19f77cfff5
commit 4419f7ca0f
3 changed files with 12 additions and 5 deletions

View File

@@ -1579,12 +1579,13 @@
}).addElse(this.second).compile(o);
};
Op.prototype.compileUnary = function(o) {
var op, parts;
var op, parts, plusMinus;
parts = [op = this.operator];
if ((op === 'new' || op === 'typeof' || op === 'delete') || (op === '+' || op === '-') && this.first instanceof Op && this.first.operator === op) {
plusMinus = op === '+' || op === '-';
if ((op === 'new' || op === 'typeof' || op === 'delete') || plusMinus && this.first instanceof Op && this.first.operator === op) {
parts.push(' ');
}
if (op === 'new' && this.first.isStatement(o)) {
if ((plusMinus && this.first instanceof Op) || (op === 'new' && this.first.isStatement(o))) {
this.first = new Parens(this.first);
}
parts.push(this.first.compile(o, LEVEL_OP));