mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-01-14 09:17:55 -05:00
always wrap 'yield' in () to allow composability with all other operators
This commit is contained in:
@@ -2472,9 +2472,9 @@
|
||||
parts.push(this.first.expression.compileToFragments(o, LEVEL_OP));
|
||||
}
|
||||
} else {
|
||||
parts.push([this.makeCode(op)]);
|
||||
parts.push([this.makeCode(' ')]);
|
||||
parts.push([this.makeCode("(" + op + " ")]);
|
||||
parts.push(this.first.compileToFragments(o, LEVEL_OP));
|
||||
parts.push([this.makeCode(")")]);
|
||||
}
|
||||
return this.joinFragmentArrays(parts, '');
|
||||
};
|
||||
|
||||
@@ -1760,9 +1760,9 @@ exports.Op = class Op extends Base
|
||||
if 'expression' in Object.keys @first
|
||||
parts.push @first.expression.compileToFragments o, LEVEL_OP if @first.expression?
|
||||
else
|
||||
parts.push [@makeCode op]
|
||||
parts.push [@makeCode(' ')]
|
||||
parts.push [@makeCode "(#{op} "]
|
||||
parts.push @first.compileToFragments o, LEVEL_OP
|
||||
parts.push [@makeCode ")"]
|
||||
@joinFragmentArrays parts, ''
|
||||
|
||||
compilePower: (o) ->
|
||||
|
||||
Reference in New Issue
Block a user