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

Ensure forEach* methods include the returned value when the function is hoisted #32

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

planttheidea
Copy link
Owner

Reason for change

I discovered that when the contents of the loop were hoisted to a function, the call of that function was getting dropped in forEach. This is because the conditionality to make the returned value the injected body was not being applied specifically in that scenario.

Change

If the method is a forEach method, inject the returned expression as an expression statement.

@planttheidea planttheidea merged commit 45e0d85 into master Dec 18, 2023
@planttheidea planttheidea deleted the fix/handle-for-each-hoisted branch December 18, 2023 17:27
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