Skip to content

Commit d59ca90

Browse files
committedFeb 6, 2016
BlockEnvironment::AsMethod#scope should return the scope of block_env
1 parent 161a787 commit d59ca90

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
 

‎core/block_environment.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def defined_line
104104
end
105105

106106
def scope
107-
nil
107+
@block_env.scope
108108
end
109109
end
110110

‎core/proc.rb

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

254-
code = Rubinius::BlockEnvironment::AsMethod.new(be)
255-
scope = code.block_env.scope
254+
executable = Rubinius::BlockEnvironment::AsMethod.new(be)
255+
256+
code = executable
257+
scope = executable.scope
256258
end
257259

258260
[code, scope]

0 commit comments

Comments
 (0)
Please sign in to comment.