mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 11:31:20 -05:00
followup to #717; made new => actually work
This commit is contained in:
30
lib/nodes.js
30
lib/nodes.js
@@ -1342,22 +1342,24 @@
|
||||
})();
|
||||
exports.Op = (function() {
|
||||
Op = (function() {
|
||||
function Op(_arg, _arg2, _arg3, flip) {
|
||||
this.second = _arg3;
|
||||
this.first = _arg2;
|
||||
this.operator = _arg;
|
||||
function Op(op, first, second, flip) {
|
||||
if (first instanceof Value && first.base instanceof ObjectLiteral) {
|
||||
first = new Parens(first);
|
||||
} else if (op === 'new') {
|
||||
if (first instanceof Call) {
|
||||
return first.newInstance();
|
||||
}
|
||||
if (first instanceof Code && first.bound) {
|
||||
first = new Parens(first);
|
||||
}
|
||||
}
|
||||
Op.__super__.constructor.call(this);
|
||||
this.operator = this.CONVERSIONS[this.operator] || this.operator;
|
||||
this.operator = this.CONVERSIONS[op] || op;
|
||||
(this.first = first).tags.operation = true;
|
||||
if (second) {
|
||||
(this.second = second).tags.operation = true;
|
||||
}
|
||||
this.flip = !!flip;
|
||||
if (this.first instanceof Value && this.first.base instanceof ObjectLiteral) {
|
||||
this.first = new Parens(this.first);
|
||||
} else if (this.operator === 'new' && this.first instanceof Call) {
|
||||
return this.first.newInstance();
|
||||
}
|
||||
this.first.tags.operation = true;
|
||||
if (this.second) {
|
||||
this.second.tags.operation = true;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
return Op;
|
||||
|
||||
Reference in New Issue
Block a user