ensure that functions are only called once, when chaining comparators

This commit is contained in:
Jeremy Ashkenas
2010-01-16 22:04:08 -05:00
parent 9679fc0b52
commit 0bc4da2b51
2 changed files with 18 additions and 2 deletions

View File

@@ -6,4 +6,13 @@ print(true is not false is true is not false)
print(10 < 20 > 10)
print(50 > 10 > 5 is parseInt('5', 10))
print(50 > 10 > 5 is parseInt('5', 10))
# Make sure that each argument is only evaluated once, even if used
# more than once.
i: 0
func: => i++
print(1 > func() < 1)