Project

General

Profile

Backport #2161

Updated by jeremyevans0 (Jeremy Evans) almost 5 years ago

=begin 
  
  Kernel.eval no longer evaluates its string in the context of the binding passed to it. 
 
  In an irb session in 1.8.6: 
 
    irb(main):001:0> eval 'self' 
    => main 
    irb(main):002:0> obj = Object.new 
    => #<Object:0x12aaf20> 
    irb(main):003:0> eval 'self', obj.send(:binding) 
    => #<Object:0x12aaf20> 
 
  In 1.9.1 (also tested in the latest nightly build for 1.9.2): 
 
    irb(main):001:0> obj = Object.new 
    => #<Object:0x5210f8> 
    irb(main):002:0> eval 'self', obj.send(:binding) 
    => main 
 
  I can't help but feel I'm missing something, because a bug of this magnitude should have been identified and fixed by now (it breaks a lot of code that uses ERb). 
 
 =end 
 

Back