mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
Moved the common code
This commit is contained in:
parent
bad61d34be
commit
1b35808a13
1 changed files with 5 additions and 4 deletions
9
vm.c
9
vm.c
|
@ -982,15 +982,16 @@ collect_outer_variable_names(ID id, VALUE val, void *ptr)
|
||||||
data->yield = true;
|
data->yield = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
VALUE *store;
|
||||||
if (data->isolate ||
|
if (data->isolate ||
|
||||||
val == Qtrue /* write */) {
|
val == Qtrue /* write */) {
|
||||||
if (data->ary == Qfalse) data->ary = rb_ary_new();
|
store = &data->ary;
|
||||||
rb_ary_push(data->ary, ID2SYM(id));
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (data->read_only == Qfalse) data->read_only = rb_ary_new();
|
store = &data->read_only;
|
||||||
rb_ary_push(data->read_only, ID2SYM(id));
|
|
||||||
}
|
}
|
||||||
|
if (*store == Qfalse) *store = rb_ary_new();
|
||||||
|
rb_ary_push(*store, ID2SYM(id));
|
||||||
}
|
}
|
||||||
return ID_TABLE_CONTINUE;
|
return ID_TABLE_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue