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

Unexpected return/break should raise LocalJumpError #2591

Merged
merged 4 commits into from
Sep 28, 2023

Conversation

takaram
Copy link
Member

@takaram takaram commented Sep 24, 2023

Orphaned Proc objects will throw LocalJumpError on return or break.
See https://ruby-doc.org/3.2.2/Proc.html#class-Proc-label-Orphaned+Proc

Some related bugs are fixed too.

lib/opal/nodes/closure.rb Outdated Show resolved Hide resolved
Copy link
Member

@elia elia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Not the easiest part to tackle 🙌 🙌 🙌

@hmdne hmdne merged commit c2c85e0 into opal:master Sep 28, 2023
20 of 21 checks passed
@takaram takaram deleted the local_jump_error branch September 28, 2023 13:55
@hmdne
Copy link
Member

hmdne commented Oct 1, 2023

This PR caused a significant failure at some codebase I'm working on (namely - https://github.com/plurimath-js/plurimath-js ). I will give more info when I get to debug it.

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.

None yet

3 participants