Commit d957a678 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1616 from h2so5/verify-string-match

verify the argument of String#=~
parents 55ef024e e137d142
...@@ -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