Block with a call to an undefined local var/method first raises a NameError; subsequent executions raise a NoMethodError #1938

Closed
alindeman opened this Issue Oct 3, 2012 · 0 comments

2 participants

@alindeman

rubinius 2.0.0dev (1.9.3 32c35a4)

blk = proc { undefined_thing }

blk.call rescue puts $!.class
blk.call rescue puts $!.class

Outputs:

NameError
NoMethodError

My somewhat uninformed gut feeling is that something in the Rubinius cache knows that after the first blk.call, the undefined_thing isn't really a vcall. However, this differs from MRI and JRuby 1.9 which both continue to raise a NameError.

@dbussink dbussink closed this in ccc3b0a Oct 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment