Skip to content

Non-local return in a block in a define_method body raises LJE when called #1960

@headius

Description

@headius

Ran into this running a Dashing app, based on Sinatra, via Puma+Rack. Here's the simplest reproduction:

class Foo
  define_method(:foo) { loop { return "foo" } }
end

Foo.new.foo

When the foo method is called, it will raise LocalJumpError.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions