my $attr_name = $attr->name;
my $meta_instance = $attr->associated_class->instance_metaclass;
- my $code = $self->_eval_closure(
+ my ( $code, $e ) = $self->_eval_closure(
{},
'sub {'
. $meta_instance->inline_set_slot_value('$_[0]', $attr_name, '$_[1]')
. $meta_instance->inline_get_slot_value('$_[0]', $attr_name)
. '}'
);
- confess "Could not generate inline accessor because : $@" if $@;
+ confess "Could not generate inline accessor because : $e" if $e;
return $code;
}
my $attr_name = $attr->name;
my $meta_instance = $attr->associated_class->instance_metaclass;
- my $code = $self->_eval_closure(
+ my ( $code, $e ) = $self->_eval_closure(
{},
'sub {'
. 'confess "Cannot assign a value to a read-only accessor" if @_ > 1;'
. $meta_instance->inline_get_slot_value('$_[0]', $attr_name)
. '}'
);
- confess "Could not generate inline reader because : $@" if $@;
+ confess "Could not generate inline reader because : $e" if $e;
return $code;
}
my $attr_name = $attr->name;
my $meta_instance = $attr->associated_class->instance_metaclass;
- my $code = $self->_eval_closure(
+ my ( $code, $e ) = $self->_eval_closure(
{},
'sub {'
. $meta_instance->inline_set_slot_value('$_[0]', $attr_name, '$_[1]')
. '}'
);
- confess "Could not generate inline writer because : $@" if $@;
+ confess "Could not generate inline writer because : $e" if $e;
return $code;
}
my $attr_name = $attr->name;
my $meta_instance = $attr->associated_class->instance_metaclass;
- my $code = $self->_eval_closure(
+ my ( $code, $e ) = $self->_eval_closure(
{},
'sub {'
. $meta_instance->inline_is_slot_initialized('$_[0]', $attr_name)
. '}'
);
- confess "Could not generate inline predicate because : $@" if $@;
+ confess "Could not generate inline predicate because : $e" if $e;
return $code;
}
my $attr_name = $attr->name;
my $meta_instance = $attr->associated_class->instance_metaclass;
- my $code = $self->_eval_closure(
+ my ( $code, $e ) = $self->_eval_closure(
{},
'sub {'
. $meta_instance->inline_deinitialize_slot('$_[0]', $attr_name)
. '}'
);
- confess "Could not generate inline clearer because : $@" if $@;
+ confess "Could not generate inline clearer because : $e" if $e;
return $code;
}