Skip to content

Commit eb465ca

Browse files
committedFeb 7, 2016
Implement Proc#for_define_method when @ruby_method is nil like in the old impl to ensure the same behavior
1 parent d59ca90 commit eb465ca

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

Diff for: ‎core/proc.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,11 @@ def for_define_method(name, klass)
251251
be = @block.dup
252252
be.change_name name
253253

254-
executable = Rubinius::BlockEnvironment::AsMethod.new(be)
254+
duped_proc = self.dup
255+
duped_proc.lambda_style!
255256

256-
code = executable
257-
scope = executable.scope
257+
code = Rubinius::BlockEnvironment::AsMethod.new(be)
258+
scope = duped_proc.block.scope
258259
end
259260

260261
[code, scope]

0 commit comments

Comments
 (0)
Please sign in to comment.