Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec needs to handle empty completion values #48

Closed
bakkot opened this issue May 27, 2020 · 2 comments
Closed

Spec needs to handle empty completion values #48

bakkot opened this issue May 27, 2020 · 2 comments

Comments

@bakkot
Copy link
Collaborator

bakkot commented May 27, 2020

For example, do { ; } has a completion value of { [[Type]]: normal, [[Value]]: empty, [[Target]]: empty }. But empty 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:

  1. If result.[[Type]] is normal and result.[[Value]] is empty, then
    a. Set result to NormalCompletion(undefined).
@bakkot
Copy link
Collaborator Author

bakkot commented May 28, 2020

In #21 (comment) @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.

@bakkot
Copy link
Collaborator Author

bakkot commented Jan 30, 2021

This is done (in particular by the call to UpdateEmpty).

@bakkot bakkot closed this as completed Jan 30, 2021
@bakkot bakkot mentioned this issue Jan 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant