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

Foreach should abort on error and return #50

Closed
Flipez opened this issue Jan 16, 2022 · 0 comments · Fixed by #62
Closed

Foreach should abort on error and return #50

Flipez opened this issue Jan 16, 2022 · 0 comments · Fixed by #62
Labels
bug Something isn't working

Comments

@Flipez
Copy link
Owner

Flipez commented Jan 16, 2022

foreach should interrupt on return or error, currently the abort handling does exlcude error in the second statement.

if rt != nil && !isError(rt) && (rt.Type() == object.RETURN_VALUE_OBJ || rt.Type() == object.ERROR_OBJ) {

should probably:

 if rt != nil && (rt.Type() == object.RETURN_VALUE_OBJ || rt.Type() == object.ERROR_OBJ) { 
@Flipez Flipez added the bug Something isn't working label Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant