You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use correct line numbers for class_eval and module_eval methods
🌈 When using heredoc, the line number that is passed to `eval` method should be a `__LINE__ + 1`.
For example
```ruby
instance_eval <<-END, __FILE__, __LINE__
raise 'In the instance_eval'
END
```
It print below.
```bash
$ ruby test.rb
test.rb:1:in `<main>': In the instance_eval (RuntimeError)
from test.rb:1:in `instance_eval'
from test.rb:1:in `<main>'
```
It says "This exception occurred on the 1st line", but the `raise` is on the 2nd line.
This change will fix this problem.
0 commit comments