Skip to content

Commit

Permalink
test for bound partially applied binary operators
Browse files Browse the repository at this point in the history
  • Loading branch information
summivox committed Jan 31, 2016
1 parent 9f96f95 commit 177bf88
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/operator.ls
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,19 @@ eq '1,2,3,4' String (++) a, [3 4]
eq '3,4,1,2' String (++ a) [3 4]
eq '1,2,3,4' String (a ++) [3 4]

# partially bound binary operators should also bind `this`
# see [#634](https://github.com/gkz/LiveScript/issues/634)
o =
x: 1
y: 2
f: ->
ok (@x ==)(1)
ok (== @x)(1)
eq 2 (+ @x)(1)
(@y =)(3)
eq 3, @y
o.f!

# Unary ops as functions
ok (not) false
ok (!).call(null, false)
Expand Down

0 comments on commit 177bf88

Please sign in to comment.