mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 03:21:20 -05:00
and now with if/else statements, CoffeeScript-in-CoffeeScript is language-complete -- now for the shakedown cruise
This commit is contained in:
@@ -1029,7 +1029,7 @@ module CoffeeScript
|
||||
# Compile the IfNode into a ternary operator.
|
||||
def compile_ternary(o)
|
||||
if_part = "#{@condition.compile(o)} ? #{@body.compile(o)}"
|
||||
else_part = @else_body ? "#{@else_body.compile(o)}" : 'null'
|
||||
else_part = @else_body ? @else_body.compile(o) : 'null'
|
||||
"#{if_part} : #{else_part}"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user