/*
* call-seq:
* binding.body => Binding
*
* Given a Binding, returns the Node for that Binding's body.
*
* On YARV, this will returning the Binding's instruction sequence.
*/
static VALUE binding_body(VALUE self)
{
#ifdef RUBY_HAS_YARV
rb_binding_t * binding;
rb_env_t * env;
GetBindingPtr(self, binding);
GetEnvPtr(binding->env, env);
return env->block.iseq->self;
#else
struct BLOCK * b;
if(ruby_safe_level >= 4)
{
/* no access to potentially sensitive data from the sandbox */
rb_raise(rb_eSecurityError, "Insecure: can't get binding body");
}
Data_Get_Struct(self, struct BLOCK, b);
return wrap_node(b->body);
#endif
}