-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
Description
-
for
with single-expression block containingundefined
:$ coffee -be 'console.log (for a in [0, 1, 2, 3] then undefined)' [ undefined, undefined, undefined, undefined ]
-
for
with empty block:$ coffee -be 'console.log (for a in [0, 1, 2, 3] then)' []
-
while
with single-expression block containingundefined
:$ coffee -be 'i = 4; console.log (while i-- then undefined)' [ undefined, undefined, undefined, undefined ]
-
while
with empty block:$ coffee -be 'i = 4; console.log (while i-- then)' undefined
The value of a for
or while
should always be a list. The behaviour of while
with an empty block should change to produce an empty list so that it is consistent with for
.
edit: an alternative (which I would actually prefer) would be to change the behaviour of the empty-block forms to match the forms with an undefined
expression.