[MacRuby] #939: $1, $2 ... should store the value of local scope.
#939: $1, $2 ... should store the value of local scope. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Test Script: {{{ #!ruby str = "info@example.com?subject=current-issue" def test(str) str =~ /(.+)@(.+)/ end if(str =~ /(.+)\?(.+)/) test($1) p $1 p $2 end }}} Result: {{{ $ ruby -v test_regexp.rb ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] "info@example.com" "subject=current-issue" $ ruby19 -v test_regexp.rb ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0] "info@example.com" "subject=current-issue" $ macruby -v test_regexp.rb MacRuby 0.8 (ruby 1.9.2) [universal-darwin10.0, x86_64] "info" "example.com" }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/939> MacRuby <http://macruby.org/>
#939: $1, $2 ... should store the value of local scope. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): Okay, this is really evil. {{{ $ ./miniruby -e 'def foo; "omg".match(/^(.)/); end; "wtf".match(/^(.)/); foo; p $1' "o" $ ruby -e 'def foo; "omg".match(/^(.)/); end; "wtf".match(/^(.)/); foo; p $1' "w" }}} {{{ $ ./miniruby -e 'def foo; "omg".match(/^(.)/); end; foo; p $1' "o" $ ruby -e 'def foo; "omg".match(/^(.)/); end; foo; p $1' nil }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/939#comment:1> MacRuby <http://macruby.org/>
#939: $1, $2 ... should store the value of local scope. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by mike.gehard@…): Still happening as for 12.4.2010 in Github trunk mirror. Compared to 1.9.2-p0. -- Ticket URL: <http://www.macruby.org/trac/ticket/939#comment:2> MacRuby <http://macruby.org/>
#939: $1, $2 ... should store the value of local scope. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: #reduction ----------------------------------+----------------------------------------- Changes (by mattaimonetti@…): * keywords: => #reduction -- Ticket URL: <http://www.macruby.org/trac/ticket/939#comment:3> MacRuby <http://macruby.org/>
#939: $1, $2 ... should store the value of local scope. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: #reduction ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * milestone: => MacRuby 1.0 -- Ticket URL: <http://www.macruby.org/trac/ticket/939#comment:4> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby