[MacRuby] #784: Exception is generated when change Hash's key.
#784: Exception is generated when change Hash's key. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- It seems that this issue blocks #753 Test Script: {{{ $ cat test_hash.rb # based on send_header() in "lib/webrick/httpresponse.rb" hash = {} hash["content-type"] = "text/html" hash.each{|key,value| p "#{key} : #{value}" tmp = key.gsub(/\bwww|^te$|\b\w/){ p $& p $&.upcase } p tmp } }}} Result of Ruby 1.9.1: {{{ $ ruby test_hash.rb "content-type : text/html" "c" "C" "t" "T" "Content-Type" }}} Result of MacRuby Trunk: {{{ $ macruby test_hash.rb "content-type : text/html" "c" "C" /Users/watson/test/ruby/macruby/test_hash.rb:6:in `block': string frozen (RuntimeError) from /Users/watson/test/ruby/macruby/test_hash.rb:5:in `<main>' }}} Test Script works when changed "key.gsub" to "key.dup.gsub". -- Ticket URL: <http://www.macruby.org/trac/ticket/784> MacRuby <http://macruby.org/>
#784: Exception is generated when change Hash's key. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): Better reduction: {{{ $ ./miniruby -e "p 'foo'.freeze.gsub(/./, '_')" "___" $ ./miniruby -e "p 'foo'.freeze.gsub(/./){'_'}" /Users/lrz/src/macruby-trunk/-e:1:in `<main>': string frozen (RuntimeError) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/784#comment:1> MacRuby <http://macruby.org/>
#784: Exception is generated when change Hash's key. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by watson1978@…): This issue did not reproduce with r4344. Thanks! -- Ticket URL: <http://www.macruby.org/trac/ticket/784#comment:2> MacRuby <http://macruby.org/>
#784: Exception is generated when change Hash's key. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.7 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.7 Comment: Indeed, forgot to mention the revision & close the ticket :) -- Ticket URL: <http://www.macruby.org/trac/ticket/784#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby