[ruby-core:85369] [Ruby trunk Bug#14162] Invoking binding.irb destructively shifts ARGV

From: nagachika00@...
Date: 2018-02-04 00:39:30 UTC
List: ruby-core #85369
Issue #14162 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.3: DONTNEED, 2.4: REQUIRED to 2.3: DONTNEED, 2.4: DONE

ruby_2_4 r62185 merged revision(s) 61149,61150,61151,61167.

----------------------------------------
Bug #14162: Invoking binding.irb destructively shifts ARGV
https://bugs.ruby-lang.org/issues/14162#change-70149

* Author: k0kubun (Takashi Kokubun)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 2.5
* ruby -v: ruby 2.5.0dev (2017-12-05 trunk 61034) [x86_64-linux]
* Backport: 2.3: DONTNEED, 2.4: DONE
----------------------------------------
~~~ ruby
$ ruby -v
ruby 2.5.0dev (2017-12-05 trunk 61034) [x86_64-linux]
$ cat script.rb
binding.irb
binding.irb
$ ruby script.rb a b c

From: script.rb @ line 1 :

 => 1: binding.irb
    2: binding.irb

irb(main):001:0> p ARGV
["b", "c"]
=> ["b", "c"]
irb(main):002:0>

From: script.rb @ line 2 :

    1: binding.irb
 => 2: binding.irb

irb(main):001:0> p ARGV
["c"]
=> ["c"]
~~~

Is this intentional? This is reproductive on both Ruby 2.4 and 2.5.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next