diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2019-08-03 07:44:44 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2019-08-03 07:44:44 +0900 |
commit | c6837638657429034825d5c9e2a29c340898afb8 (patch) | |
tree | 4655331430ef09099960a1f50aba8769a6e870e1 /lib/irb.rb | |
parent | 44ddfec0bd366cd2337fd34847cddedd0a7b6775 (diff) |
Use source_location instead of eval(__FILE__,binding) in Binding#irb
e9e17cbc051e894dfd27eda5feca2939f65552db (enabling the warning by
default) caused a warning in test-spec:
```
/data/chkbuild/tmp/build/20190802T213005Z/ruby/spec/ruby/core/binding/irb_spec.rb
Binding#irb
- creates an IRB session with the binding in scope/data/chkbuild/tmp/build/20190802T213005Z/ruby/spec/ruby/core/binding/fixtures/irb.rb:3: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
```
https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-master/log/20190802T213005Z.log.html.gz
ref: [Bug #4352]
Diffstat (limited to 'lib/irb.rb')
-rw-r--r-- | lib/irb.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/irb.rb b/lib/irb.rb index f9c27782b9..a08aa874c9 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -805,7 +805,7 @@ class Binding # # See IRB@IRB+Usage for more information. def irb - IRB.setup(eval("__FILE__"), argv: []) + IRB.setup(source_location[0], argv: []) workspace = IRB::WorkSpace.new(self) STDOUT.print(workspace.code_around_binding) IRB::Irb.new(workspace).run(IRB.conf) |