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

CSE Machine: sequences with let/const should not be reordered #1726

Open
martin-henz opened this issue Oct 15, 2024 · 3 comments
Open

CSE Machine: sequences with let/const should not be reordered #1726

martin-henz opened this issue Oct 15, 2024 · 3 comments
Labels
Bug Something isn't working minor less important than important but more than nice-to-have

Comments

@martin-henz
Copy link
Member

martin-henz commented Oct 15, 2024

1;
let x = 1;

currently gives:
Screenshot 2024-10-15 at 1 37 53 PM

which may give the correct result but which is confusing.

@martin-henz martin-henz added Bug Something isn't working minor less important than important but more than nice-to-have labels Oct 15, 2024
@RichDom2185
Copy link
Member

RichDom2185 commented Oct 15, 2024

Is this not the correct behaviour? Since the control is read bottom-to-top?

@RichDom2185
Copy link
Member

let x = 0;
1;
2;
3;

gives the wrong result: 1, instead of 3.

I can't replicate this?

image

@martin-henz
Copy link
Member Author

Sorry, messages crossed. Yes, I was confused. Only the first issue that I posted is valid. So the current post states the problem: a confusing reordering of statements, in case of const/let mixed with value-producing statements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working minor less important than important but more than nice-to-have
Projects
None yet
Development

No branches or pull requests

2 participants