Closed bakkot closed 3 years ago
In https://github.com/tc39/proposal-do-expressions/issues/21#issuecomment-359878642 @allenwb says
The do expression
do {}
needs to evaluate to[[Type]]: normal, [[Value]]: empty
so it has Tennant's correspondence with{ }
when used in a statement context.
I disagree with this; I think it's fine for (do { 0; (do {}); })
to be undefined
instead of 0
, despite the Tennant's correspondence violation.
For example,
do { ; }
has a completion value of{ [[Type]]: normal, [[Value]]: empty, [[Target]]: empty }
. Butempty
is not a value which can actually be used in an expression. That case needs to be handled explicitly, as in step 27 of PerformEval: