Modifying frozen objects will raise FrozenError.

`FrozenError` is a subclass of `RuntimeError` which used to be
raised.  [Ruby2.5]
This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-12-12 18:41:18 +09:00
parent d4ff92bcf6
commit bbb0882343
10 changed files with 16 additions and 12 deletions
+1 -1
View File
@@ -494,7 +494,7 @@ static void
check_frozen(mrb_state *mrb, struct RString *s)
{
if (MRB_FROZEN_P(s)) {
mrb_raise(mrb, E_RUNTIME_ERROR, "can't modify frozen string");
mrb_raise(mrb, E_FROZEN_ERROR, "can't modify frozen string");
}
}