[MacRuby/MacRuby] 611381: String#each_char will yield subclass instance.
Branch: refs/heads/master Home: https://github.com/MacRuby/MacRuby Commit: 61138147d28caceec6c797dce85a5bba3ba30437 https://github.com/MacRuby/MacRuby/commit/61138147d28caceec6c797dce85a5bba3b... Author: Watson <watson1978@gmail.com> Date: 2011-04-21 (Thu, 21 Apr 2011) Changed paths: M string.c Log Message: ----------- String#each_char will yield subclass instance. Test Script: {{{ require 'test/unit/assertions.rb' include Test::Unit::Assertions class SubStr < String def value "value : " + self end end str = SubStr.new("abcd") str.each_char {|c| assert_equal(SubStr, c.class) puts c.value } puts :ok }}} Commit: be34f68aca462aaf010f74f5d626e098dbafae3d https://github.com/MacRuby/MacRuby/commit/be34f68aca462aaf010f74f5d626e098db... Author: Watson <watson1978@gmail.com> Date: 2011-04-21 (Thu, 21 Apr 2011) Changed paths: M string.c Log Message: ----------- String#succ will return subclass instance. Test Script: {{{ require 'test/unit/assertions.rb' include Test::Unit::Assertions class SubStr < String def value "value : " + self end end str = SubStr.new("abcd") assert_equal(SubStr, str.succ.class) puts :ok }}} Compare: https://github.com/MacRuby/MacRuby/compare/636eed7...be34f68
participants (1)
-
noreply@github.com