Proc looses context #218

niccokunzmann opened this Issue Jan 23, 2013 · 0 comments


None yet
1 participant

niccokunzmann commented Jan 23, 2013


I encountered the following, unexpected behavior:
The context where the Proc is created gets lost and when the Proc is called, it uses the varaibles from where was done.

This is irb 1.9 and my expected:

x = # create context
p = x.instance_eval 'l = [];{l<< 3;l}' # create proc in this context
=> #< Proc:0x00000002bf0ac0@(eval):1 > # call the proc
=> [3]

This is MagLev, branch hpi & master

l = StandardError
x =
p = x.instance_eval 'l = [];{l<< 3;l}'
=> #< Proc >
NoMethodError: NoMethodError: undefined method <<' for StandardError:Class from (eval) from line 2 of <eval>:3:in__compileEval'
from /home/Documents/maglev/HPI-GSS-BuildEnv/git/src/kernel/bootstrap/Proc.rb:331:in call' from (irb):5:in__compileEval'
from (irb):7:in __compileEval' from /home/Documents/maglev/HPI-GSS-BuildEnv/git/src/kernel/bootstrap/Kernel.rb:402:ineval'
from /home/Documents/maglev/HPI-GSS-BuildEnv/git/lib/ruby/1.8/irb.rb:159:in `eval_input'
from /home/.rbenv/versions/maglev/bin/maglev-irb:30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment