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

Conditional operator e1 ? e2 : e3 evaluating both branches #150

Open
andreffnascimento opened this issue Jul 28, 2024 · 0 comments
Open
Labels
scope-language Related to the ECMA-SL language design type: bug work: complex

Comments

@andreffnascimento
Copy link
Contributor

The conditional operator e1 ? e2 : e3 evaluates both expressions e2 and e3 regardless of the value of e1. This is not the intended behaviour in the concrete interpreter. Regardless, fixing this issue is difficult, because of the way we are compiling this operator.

compile (e1 ? e2 : e3) :=
  e1' = compile (e1);
  e2' = compile (e2);
  e3' = compile (e3);
  e1' ? e2' : e3'
@andreffnascimento andreffnascimento added bug scope-language Related to the ECMA-SL language design labels Jul 28, 2024
andreffnascimento added a commit that referenced this issue Aug 2, 2024
This commit does not fix the bug. We oppened an issue for this (#150)
andreffnascimento added a commit that referenced this issue Aug 2, 2024
This commit does not fix the bug. We oppened an issue for this (#150)
@filipeom filipeom added type: bug and removed bug labels Aug 14, 2024
filipeom pushed a commit that referenced this issue Dec 27, 2024
This commit does not fix the bug. We oppened an issue for this (#150)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope-language Related to the ECMA-SL language design type: bug work: complex
Projects
None yet
Development

No branches or pull requests

2 participants