Commit e137d142 authored by h2so5's avatar h2so5

verify the argument of String#=~

parent 55ef024e
...@@ -137,6 +137,9 @@ class String ...@@ -137,6 +137,9 @@ class String
## ##
# ISO 15.2.10.5.5 # ISO 15.2.10.5.5
def =~(re) def =~(re)
if re.is_a? String
raise TypeError, "type mismatch: String given"
end
re =~ self re =~ self
end 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