mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #1616 from h2so5/verify-string-match
verify the argument of String#=~
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user