sub generate_constructor_method_inline {
my ($class, $meta) = @_;
- my @attrs = $meta->compute_all_applicable_attributes; # this one is using by evaled code
+ my @attrs = $meta->compute_all_applicable_attributes;
my $buildall = $class->_generate_BUILDALL($meta);
my $buildargs = $class->_generate_BUILDARGS();
my $processattrs = $class->_generate_processattrs($meta, \@attrs);
}
...
- warn $code if $ENV{DEBUG};
-
local $@;
my $res = eval $code;
die $@ if $@;
push @code, "\$instance->{'$key'} = \$value;";
if ($attr->is_weak_ref) {
- push @code, "weaken( \$instance->{'$key'} ) if ref( \$value );";
+ push @code, "Scalar::Util::weaken( \$instance->{'$key'} ) if ref( \$value );";
}
if ( $attr->has_trigger ) {
push @code, "\$instance->{'$key'} = \$value;";
if ($attr->is_weak_ref) {
- push @code, "weaken( \$instance->{'$key'} ) if ref( \$value );";
+ push @code, "Scalar::Util::weaken( \$instance->{'$key'} ) if ref( \$value );";
}
}
join "\n", @code;