Revert "removing the special case for | or"

This reverts commit 9763839ed1.
This commit is contained in:
Jeremy Ashkenas
2010-03-27 15:25:27 -04:00
parent 030476d335
commit 4dd40034ed
6 changed files with 127 additions and 127 deletions

View File

@@ -1284,16 +1284,15 @@ exports.IfNode: class IfNode extends BaseNode
exports.PipeNode: class PipeNode extends BaseNode
type: 'Pipe'
constructor: (left, right) ->
constructor: (left, right, fallback) ->
@children: [@left: left, @right: right]
compile_bitwise_or: (o) ->
new OpNode('|', @left, @right).compile o
@fallback: fallback
compile_node: (o) ->
return compile_bitwise_or o unless @right instanceof CallNode and not (@right.is_new or @right.is_super)
@right.args.unshift @left
@right.compile o
if @right instanceof CallNode and not (@right.is_new or @right.is_super)
@right.args.unshift @left
return @right.compile o
new OpNode((if @fallback and @left instanceof PipeNode then '||' else '|'), @left, @right).compile o
# Faux-Nodes
# ----------