Skip to content

Commit

Permalink
Fixed if function behaivour
Browse files Browse the repository at this point in the history
  • Loading branch information
L8D committed Aug 16, 2013
1 parent 82e94d7 commit f73d9d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/corelib.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ fns =
# Returns interpreted second arg if first arg evaluates to true.
# Otherwise it returns the interpreted third argument.
if: (input, context) ->
if input[0]
whip.interpret input[1], context
if whip.interpret input[1]
whip.interpret input[2], context
else
whip.interpret input[2], context if input[2]?
whip.interpret input[3], context if input[2]?

module.exports = fns
# Lambda shortcut of `->`
Expand Down

0 comments on commit f73d9d1

Please sign in to comment.