fixing #768, preserving execution order of in arguments when compiled

to an `or`.
This commit is contained in:
Michael Ficarra
2010-10-13 12:10:36 -04:00
parent 1d4d7e96fa
commit 1ea38d2f93
5 changed files with 20 additions and 20 deletions

View File

@@ -259,7 +259,7 @@
};
Literal.prototype.isStatement = function() {
var _ref2;
return ('break' === (_ref2 = this.value) || 'continue' === _ref2 || 'debugger' === _ref2);
return ((_ref2 = this.value) === 'break' || _ref2 === 'continue' || _ref2 === 'debugger');
};
Literal.prototype.isPureStatement = Literal.prototype.isStatement;
Literal.prototype.isComplex = NO;
@@ -1398,14 +1398,14 @@
};
Op.prototype.isMutator = function() {
var _ref2;
return ends(this.operator, '=') && !('===' === (_ref2 = this.operator) || '!==' === _ref2);
return ends(this.operator, '=') && !((_ref2 = this.operator) === '===' || _ref2 === '!==');
};
Op.prototype.isChainable = function() {
return include(this.CHAINABLE, this.operator);
};
Op.prototype.invert = function() {
var _ref2;
if (('===' === (_ref2 = this.operator) || '!==' === _ref2)) {
if (((_ref2 = this.operator) === '===' || _ref2 === '!==')) {
this.operator = this.INVERSIONS[this.operator];
return this;
} else return this.second ? new Parens(this).invert() : Op.__super__.invert.call(this);
@@ -1497,7 +1497,7 @@
_result = [];
for (i = 0, _len = (_ref2 = this.array.base.objects).length; i < _len; i++) {
item = _ref2[i];
_result.push("" + (item.compile(o)) + " === " + (i ? this.obj2 : this.obj1));
_result.push("" + (i ? this.obj2 : this.obj1) + " === " + (item.compile(o)));
}
return _result;
}).call(this);