return sub { Class::MOP::Class->initialize(shift)->new_object(@_) }
}
-sub _generate_constructor_method_inline {
+sub _eval_environment {
my $self = shift;
-
my $defaults = [map { $_->default } @{ $self->_attributes }];
- my $close_over = {
+ return {
'$defaults' => \$defaults,
};
+}
+
+sub _generate_constructor_method_inline {
+ my $self = shift;
my $meta = $self->associated_metaclass;
warn join("\n", @source) if $self->options->{debug};
my $code = try {
- $self->_compile_code(
- source => \@source,
- environment => $close_over,
- );
+ $self->_compile_code(\@source);
}
catch {
my $source = join("\n", @source);