[#65451] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
ko1@atdot.net wrote:
Eric Wong <normalperson@yhbt.net> wrote:
Eric Wong <normalperson@yhbt.net> wrote:
On 2014/10/09 11:04, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
[#65453] [ruby-trunk - Feature #10328] [PATCH] make OPT_SUPPORT_JOKE a proper VM option — ko1@...
Issue #10328 has been updated by Koichi Sasada.
[#65559] is there a name for this? — Xavier Noria <fxn@...>
When describing stuff about constants (working in their guide), you often
On 2014/10/09 20:41, Xavier Noria wrote:
On Thu, Oct 9, 2014 at 1:59 PM, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
[#65566] [ruby-trunk - Feature #10351] [Open] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been reported by Shyouhei Urabe.
[#65741] Re: [ruby-cvs:55121] normal:r47971 (trunk): test/ruby/test_rubyoptions.rb: fix race — Nobuyoshi Nakada <nobu@...>
On 2014/10/16 10:10, normal@ruby-lang.org wrote:
Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
2014-10-16 12:48 GMT+09:00 Eric Wong <normalperson@yhbt.net>:
[#65753] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
[#65818] [ruby-trunk - Feature #10351] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been updated by Shyouhei Urabe.
[ruby-core:65583] [ruby-trunk - Bug #10353] [Closed] weird behavior when dynamically adding method using instance_eval
Issue #10353 has been updated by Nobuyoshi Nakada.
Description updated
Status changed from Open to Closed
----------------------------------------
Bug #10353: weird behavior when dynamically adding method using instance_eval
https://bugs.ruby-lang.org/issues/10353#change-49330
* Author: Dyego Costa
* Status: Closed
* Priority: Normal
* Assignee:
* Category: core
* Target version:
* ruby -v: 2.1.2
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
Earlier this week I cross by a weird bug using a gem and after digging into the problem I found this issue with MRI.
I could not reproduce it on 1.9.3-p545 nor on the 2.2.0-preview1, the issue occurs on the 2.1.2
~~~
2.1.2 :001 > class Foo
2.1.2 :002?> def bar(msg)
2.1.2 :003?> puts msg
2.1.2 :004?> end
2.1.2 :005?> end
=> :bar
2.1.2 :006 > foo = Foo.new
=> #<Foo:0x007f9e1410e780>
2.1.2 :007 > foo.instance_eval("def bar2(*args, &block) bar(*args, &block) end")
=> :bar2
2.1.2 :008 > foo.respond_to?(:bar2)
=> true
2.1.2 :009 > foo.bar2
ArgumentError: wrong number of arguments (0 for 1)
from (irb):2:in `bar'
from (eval):1:in `bar2'
from (irb):9
from /Users/dyego/.rvm/rubies/ruby-2.1.2/bin/irb:11:in `<main>'
2.1.2 :010 > foo.bar2('bar')
bar
=> nil
2.1.2 :011 > foo.bar2
=> nil
2.1.2 :012 > foo.bar2
=> nil
~~~
It behaves as expected on the 1.9.3 as it does on the 2.2.0-preview1
~~~
1.9.3-p545 :001 > class Foo
1.9.3-p545 :002?> def bar(msg)
1.9.3-p545 :003?> puts msg
1.9.3-p545 :004?> end
1.9.3-p545 :005?> end
=> nil
1.9.3-p545 :006 > foo = Foo.new
=> #<Foo:0x007fb114043130>
1.9.3-p545 :007 > foo.instance_eval("def bar2(*args, &block) bar(*args, &block) end")
=> nil
1.9.3-p545 :008 > foo.respond_to?(:bar2)
=> true
1.9.3-p545 :009 > foo.bar2
ArgumentError: wrong number of arguments (0 for 1)
from (irb):2:in `bar'
from (eval):1:in `bar2'
from (irb):9
from /Users/dyego/.rvm/rubies/ruby-1.9.3-p545/bin/irb:12:in `<main>'
1.9.3-p545 :010 > foo.bar2('bar')
bar
=> nil
1.9.3-p545 :011 > foo.bar2
ArgumentError: wrong number of arguments (0 for 1)
from (irb):2:in `bar'
from (eval):1:in `bar2'
from (irb):11
from /Users/dyego/.rvm/rubies/ruby-1.9.3-p545/bin/irb:12:in `<main>'
~~~
--
https://bugs.ruby-lang.org/