diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-08 05:27:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-08 05:27:10 +0000 |
commit | 506b25aabf66c54cffe478958f8672f7fe6fa669 (patch) | |
tree | e495e3702055d35e72535494ac9bef541ca5a81c /vm.c | |
parent | cb3b463a50dee9d4e3d174dc9b1d7c8181678cd4 (diff) | |
download | ruby-506b25aabf66c54cffe478958f8672f7fe6fa669.tar.gz |
error.c: name_err_local_variables
* error.c (name_err_local_variables): new method
NameError#local_variables for internal use only.
[Feature #11777]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -755,6 +755,17 @@ rb_vm_env_local_variables(const rb_env_t *env) return local_var_list_finish(&vars); } +VALUE +rb_iseq_local_variables(const rb_iseq_t *iseq) +{ + struct local_var_list vars; + local_var_list_init(&vars); + while (collect_local_variables_in_iseq(iseq, &vars)) { + iseq = iseq->body->parent_iseq; + } + return local_var_list_finish(&vars); +} + /* Proc */ static inline VALUE |