Commit e137d142 authored by h2so5's avatar h2so5

verify the argument of String#=~

parent 55ef024e
......@@ -137,6 +137,9 @@ class String
##
# ISO 15.2.10.5.5
def =~(re)
if re.is_a? String
raise TypeError, "type mismatch: String given"
end
re =~ self
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment