[Moose-commits] r7759 - in Moose/trunk: . lib lib/Moose/Meta/Method
autarch at code2.0beta.co.uk
autarch at code2.0beta.co.uk
Fri Feb 20 20:11:05 GMT 2009
Author: autarch
Date: 2009-02-20 12:11:05 -0800 (Fri, 20 Feb 2009)
New Revision: 7759
Modified:
Moose/trunk/Makefile.PL
Moose/trunk/lib/Moose.pm
Moose/trunk/lib/Moose/Meta/Method/Accessor.pm
Moose/trunk/lib/Moose/Meta/Method/Constructor.pm
Log:
Changes to work with 0.78 meta-instance code, which no longer expects
a quoted attr name when inlning attr access.
Modified: Moose/trunk/Makefile.PL
===================================================================
--- Moose/trunk/Makefile.PL 2009-02-20 20:03:21 UTC (rev 7758)
+++ Moose/trunk/Makefile.PL 2009-02-20 20:11:05 UTC (rev 7759)
@@ -12,7 +12,7 @@
requires 'Scalar::Util' => '1.19';
requires 'Carp';
-requires 'Class::MOP' => '0.77';
+requires 'Class::MOP' => '0.78';
requires 'List::MoreUtils' => '0.12';
requires 'Sub::Exporter' => '0.972';
requires 'Task::Weaken' => '0';
Modified: Moose/trunk/lib/Moose/Meta/Method/Accessor.pm
===================================================================
--- Moose/trunk/lib/Moose/Meta/Method/Accessor.pm 2009-02-20 20:03:21 UTC (rev 7758)
+++ Moose/trunk/lib/Moose/Meta/Method/Accessor.pm 2009-02-20 20:11:05 UTC (rev 7759)
@@ -217,10 +217,9 @@
my $attr = $self->associated_attribute;
my $mi = $attr->associated_class->get_meta_instance;
- my $slot_name = sprintf "'%s'", $attr->slots;
- my $code = $mi->inline_set_slot_value($instance, $slot_name, $value) . ";";
- $code .= $mi->inline_weaken_slot_value($instance, $slot_name, $value) . ";"
+ my $code = $mi->inline_set_slot_value($instance, $attr->slots, $value) . ";";
+ $code .= $mi->inline_weaken_slot_value($instance, $attr->slots, $value) . ";"
if $attr->is_weak_ref;
return $code;
}
@@ -237,9 +236,8 @@
my $attr = $self->associated_attribute;
my $mi = $attr->associated_class->get_meta_instance;
- my $slot_name = sprintf "'%s'", $attr->slots;
- return $mi->inline_get_slot_value($instance, $slot_name);
+ return $mi->inline_get_slot_value($instance, $attr->slots);
}
sub _inline_access {
@@ -247,9 +245,8 @@
my $attr = $self->associated_attribute;
my $mi = $attr->associated_class->get_meta_instance;
- my $slot_name = sprintf "'%s'", $attr->slots;
- return $mi->inline_slot_access($instance, $slot_name);
+ return $mi->inline_slot_access($instance, $attr->slots);
}
sub _inline_has {
@@ -257,9 +254,8 @@
my $attr = $self->associated_attribute;
my $mi = $attr->associated_class->get_meta_instance;
- my $slot_name = sprintf "'%s'", $attr->slots;
- return $mi->inline_is_slot_initialized($instance, $slot_name);
+ return $mi->inline_is_slot_initialized($instance, $attr->slots);
}
sub _inline_auto_deref {
Modified: Moose/trunk/lib/Moose/Meta/Method/Constructor.pm
===================================================================
--- Moose/trunk/lib/Moose/Meta/Method/Constructor.pm 2009-02-20 20:03:21 UTC (rev 7758)
+++ Moose/trunk/lib/Moose/Meta/Method/Constructor.pm 2009-02-20 20:11:05 UTC (rev 7759)
@@ -221,7 +221,7 @@
. '$instance, '
. $self->meta_instance->inline_get_slot_value(
'$instance',
- ("'" . $attr->name . "'")
+ $attr->name,
)
. ', '
. '$attrs->[' . $i . ']'
@@ -319,7 +319,7 @@
$source = (
$self->meta_instance->inline_set_slot_value(
'$instance',
- ("'" . $attr->name . "'"),
+ $attr->name,
$value
) . ';'
);
@@ -332,7 +332,7 @@
"\n" .
$self->meta_instance->inline_weaken_slot_value(
'$instance',
- ("'" . $attr->name . "'")
+ $attr->name
) .
' if ref ' . $value . ';'
);
Modified: Moose/trunk/lib/Moose.pm
===================================================================
--- Moose/trunk/lib/Moose.pm 2009-02-20 20:03:21 UTC (rev 7758)
+++ Moose/trunk/lib/Moose.pm 2009-02-20 20:11:05 UTC (rev 7759)
@@ -15,7 +15,7 @@
use Moose::Exporter;
-use Class::MOP 0.77;
+use Class::MOP 0.78;
use Moose::Meta::Class;
use Moose::Meta::TypeConstraint;
More information about the Moose-commits
mailing list