Ticket #784 (closed defect: fixed)
Exception is generated when change Hash's key.
| Reported by: | watson1978@… | Owned by: | lsansonetti@… |
|---|---|---|---|
| Priority: | blocker | Milestone: | MacRuby 0.7 |
| Component: | MacRuby | Keywords: | |
| Cc: |
Description
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".
Change History
Note: See
TracTickets for help on using
tickets.

