Skip to content

fix: implement short-circuit evaluation for logical operators in interpreter #31

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

Merged
merged 1 commit into from
Mar 28, 2025

Conversation

BQXBQX
Copy link
Collaborator

@BQXBQX BQXBQX commented Mar 28, 2025

  • Added short-circuit evaluation for && and || operators in the evaluateBinaryExpression function.
  • Updated tests to verify the behavior of logical operators without async/await.
  • fixed: parse isActive && isActive.value error #30

@BQXBQX BQXBQX requested a review from hustcc March 28, 2025 11:00
@hustcc
Copy link
Member

hustcc commented Mar 28, 2025

支持 非 操作吗?

@BQXBQX
Copy link
Collaborator Author

BQXBQX commented Mar 28, 2025

不是的,原来就是支持非操作的,这个 pr 是修改短路和断路逻辑上的一个问题,原先的是左右变量并行求值了,正确的应该是按照从左到右的顺序执行。

@BQXBQX BQXBQX merged commit ce1a926 into main Mar 28, 2025
1 check passed
@BQXBQX BQXBQX deleted the fix/30 branch March 28, 2025 11:06
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

Successfully merging this pull request may close these issues.

parse isActive && isActive.value error
2 participants