[macruby-changes] [MacRuby/MacRuby] 690627: String#to_s will copy status of taint/untrust.

noreply at github.com noreply at github.com
Sun Apr 24 02:32:46 PDT 2011


Branch: refs/heads/master
Home:   https://github.com/MacRuby/MacRuby

Commit: 69062719974a0b3f5e47c58f5afab9b423eeab99
    https://github.com/MacRuby/MacRuby/commit/69062719974a0b3f5e47c58f5afab9b423eeab99
Author: Watson <watson1978 at gmail.com>
Date:   2011-04-24 (Sun, 24 Apr 2011)

Changed paths:
  M string.c

Log Message:
-----------
String#to_s will copy status of taint/untrust.

Test Script:
{{{
require 'test/unit/assertions.rb'
include Test::Unit::Assertions

class SubStr < String
  def value
    "value : " + self
  end
end

str = SubStr.new("hello")
str.taint
str.untrust

s = str.to_s
assert_equal(true, s.tainted?)
assert_equal(true, s.untrusted?)
assert_equal(String, s.class)

puts :ok
}}}




More information about the macruby-changes mailing list