[MacRuby/MacRuby] c49536: MatchData#string will return same class as origina...
Branch: refs/heads/master Home: https://github.com/MacRuby/MacRuby Commit: c49536f8153d663344a8240e58f87cd572871aa2 https://github.com/MacRuby/MacRuby/commit/c49536f8153d663344a8240e58f87cd572... Author: Watson <watson1978@gmail.com> Date: 2011-04-22 (Fri, 22 Apr 2011) Changed paths: M re.c Log Message: ----------- MatchData#string will return same class as original string. and will copy status of taint/untrust from original string. Test Script: {{{ require 'test/unit/assertions.rb' include Test::Unit::Assertions class SubStr < String def value "value : " + self end end str = SubStr.new("hello\n world") str.untrust str.taint s = str.match(/world/) p s.string.value assert_equal(SubStr, s.string.class) assert_equal(true, s.string.tainted?) assert_equal(true, s.string.untrusted?) puts :ok }}}
participants (1)
-
noreply@github.com