X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FObject.pm;h=623fa64101c2a42b763d4317e45fd200ad30875a;hb=9b28c1d7f680305bfe0afda57775ec00eaf6219c;hp=81cb9bf87a20aac1754b2899a813fa283141358c;hpb=d07212475afdc6ff3c61b9a63c1dd1dd326ff003;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Object.pm b/lib/Mouse/Object.pm index 81cb9bf..623fa64 100644 --- a/lib/Mouse/Object.pm +++ b/lib/Mouse/Object.pm @@ -2,9 +2,8 @@ package Mouse::Object; use strict; use warnings; -use MRO::Compat; -use Scalar::Util qw/blessed weaken/; +use Scalar::Util qw/weaken/; use Carp 'confess'; sub new { @@ -20,10 +19,6 @@ sub new { my $default; if (defined($from) && exists($args->{$from})) { - if ($attribute->has_trigger && $attribute->trigger->{before}) { - $attribute->trigger->{before}->($instance, $args->{$from}, $attribute); - } - $attribute->verify_type_constraint($args->{$from}) if $attribute->has_type_constraint; @@ -32,8 +27,8 @@ sub new { weaken($instance->{$key}) if ref($instance->{$key}) && $attribute->is_weak_ref; - if ($attribute->has_trigger && $attribute->trigger->{after}) { - $attribute->trigger->{after}->($instance, $args->{$from}, $attribute); + if ($attribute->has_trigger) { + $attribute->trigger->($instance, $args->{$from}, $attribute); } } else {