mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Implement Object#freeze
This commit is contained in:
@@ -108,6 +108,10 @@ ary_fill_with_nil(mrb_value *ptr, mrb_int size)
|
||||
static void
|
||||
ary_modify(mrb_state *mrb, struct RArray *a)
|
||||
{
|
||||
if (RBASIC_FROZEN_P(a)) {
|
||||
mrb_raise(mrb, E_RUNTIME_ERROR, "can't modify frozen array");
|
||||
}
|
||||
|
||||
if (ARY_SHARED_P(a)) {
|
||||
mrb_shared_array *shared = a->aux.shared;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user