diff options
| author | h2so5 <[email protected]> | 2013-12-24 00:09:34 +0900 |
|---|---|---|
| committer | h2so5 <[email protected]> | 2013-12-24 00:09:34 +0900 |
| commit | e137d1423dd8545e48b40166d8248c846f232e17 (patch) | |
| tree | 1e8ae6849437b0cbebe6c94d3b021d66a720ebce /mrblib/string.rb | |
| parent | 55ef024e8395db13c27a519efb0f0afcad5297d0 (diff) | |
| download | mruby-e137d1423dd8545e48b40166d8248c846f232e17.tar.gz mruby-e137d1423dd8545e48b40166d8248c846f232e17.zip | |
verify the argument of String#=~
Diffstat (limited to 'mrblib/string.rb')
| -rw-r--r-- | mrblib/string.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mrblib/string.rb b/mrblib/string.rb index 49f87be8b..53e7c10c0 100644 --- a/mrblib/string.rb +++ b/mrblib/string.rb @@ -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 |
