mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Modifying frozen objects will raise FrozenError.
`FrozenError` is a subclass of `RuntimeError` which used to be raised. [Ruby2.5]
This commit is contained in:
+1
-1
@@ -286,7 +286,7 @@ static void
|
||||
mrb_hash_modify(mrb_state *mrb, mrb_value hash)
|
||||
{
|
||||
if (MRB_FROZEN_P(mrb_hash_ptr(hash))) {
|
||||
mrb_raise(mrb, E_RUNTIME_ERROR, "can't modify frozen hash");
|
||||
mrb_raise(mrb, E_FROZEN_ERROR, "can't modify frozen hash");
|
||||
}
|
||||
mrb_hash_tbl(mrb, hash);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user