Fixing compound assignment as a right-hand sub expression of a larger operation. Invalid in JS, valid in Coffee.

This commit is contained in:
Jeremy Ashkenas
2010-08-14 14:43:25 -04:00
parent ca18f1fad6
commit c71f2794eb
6 changed files with 32 additions and 9 deletions

View File

@@ -129,4 +129,12 @@ obj and=
two: 2
ok not obj.one
ok obj.two is 2
ok obj.two is 2
# Compound assignment as a sub expression.
[a, b, c] = [1, 2, 3]
ok (a + b += c) is 6
ok a is 1
ok b is 5
ok c is 3