mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Use source_location instead of eval(__FILE__,binding) in Binding#irb
e9e17cbc05
(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]
This commit is contained in:
parent
44ddfec0bd
commit
c683763865
1 changed files with 1 additions and 1 deletions
|
@ -805,7 +805,7 @@ class Binding
|
||||||
#
|
#
|
||||||
# See IRB@IRB+Usage for more information.
|
# See IRB@IRB+Usage for more information.
|
||||||
def irb
|
def irb
|
||||||
IRB.setup(eval("__FILE__"), argv: [])
|
IRB.setup(source_location[0], argv: [])
|
||||||
workspace = IRB::WorkSpace.new(self)
|
workspace = IRB::WorkSpace.new(self)
|
||||||
STDOUT.print(workspace.code_around_binding)
|
STDOUT.print(workspace.code_around_binding)
|
||||||
IRB::Irb.new(workspace).run(IRB.conf)
|
IRB::Irb.new(workspace).run(IRB.conf)
|
||||||
|
|
Loading…
Reference in a new issue