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

Fixed an edge case with silent returns #402

Merged
merged 4 commits into from
Aug 25, 2020
Merged

Conversation

odino
Copy link
Collaborator

@odino odino commented Aug 25, 2020

Silent returns (return) wren't working, and were not covered by
exhaustive tests.

This PR fixes them and adds some mor sophisticated tests. A return
without a value, when interpretd before this PR, would terminate
the script without executing the rest of the code.

This snippet:

if false {
	return
}
return 3

would return NULL instead of 3.

Silent returns (`return`) wren't working, and were not covered by
exhaustive tests.

This PR fixes them and adds some mor sophisticated tests. A `return`
without a value, when interpretd before this PR, would terminate
the script without executing the rest of the code.

This snippet:

```
if false {
	return
}
return 3
```

would return `NULL` instead of `3`.
@odino odino added this to the 2.3.x milestone Aug 25, 2020
@odino odino merged commit 126528c into 2.3.x Aug 25, 2020
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.

1 participant