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
@@ -114,7 +114,7 @@ static void
ary_modify_check(mrb_state *mrb, struct RArray *a)
{
if (MRB_FROZEN_P(a)) {
mrb_raise(mrb, E_RUNTIME_ERROR, "can't modify frozen array");
mrb_raise(mrb, E_FROZEN_ERROR, "can't modify frozen array");
}
}