1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* vm.c (collect_local_variables_in_env): skips internal variables.

[ruby-core:25125]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-08-26 03:37:08 +00:00
parent 1af43ae867
commit b6cf785119
3 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Wed Aug 26 12:36:58 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vm.c (collect_local_variables_in_env): skips internal variables.
[ruby-core:25125]
Tue Aug 25 23:51:07 2009 NARUSE, Yui <naruse@ruby-lang.org>
* tool/enc-unicode.rb: added for generate name2ctype.kwd.

View file

@ -297,5 +297,14 @@ assert_equal "(eval):1:in `block in <main>': ", %q{
rescue => e
e.message
end
}, ' [ruby-dev:35392]'
}, '[ruby-dev:35392]'
assert_equal "[:x]", %q{
def kaboom!
yield.eval("local_variables")
end
for x in enum_for(:kaboom!)
binding
end
}, '[ruby-core:25125]'

2
vm.c
View file

@ -382,7 +382,7 @@ collect_local_variables_in_env(rb_env_t * const env, const VALUE ary)
int i;
for (i = 0; i < env->block.iseq->local_table_size; i++) {
ID lid = env->block.iseq->local_table[i];
if (lid) {
if (rb_is_local_id(lid)) {
rb_ary_push(ary, ID2SYM(lid));
}
}