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
@@ -261,7 +261,7 @@ mrb_obj_iv_set(mrb_state *mrb, struct RObject *obj, mrb_sym sym, mrb_value v)
|
||||
iv_tbl *t = obj->iv;
|
||||
|
||||
if (MRB_FROZEN_P(obj)) {
|
||||
mrb_raisef(mrb, E_RUNTIME_ERROR, "can't modify frozen %S", mrb_obj_value(obj));
|
||||
mrb_raisef(mrb, E_FROZEN_ERROR, "can't modify frozen %S", mrb_obj_value(obj));
|
||||
}
|
||||
if (!t) {
|
||||
t = obj->iv = iv_new(mrb);
|
||||
|
||||
Reference in New Issue
Block a user