summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-04-14 22:58:34 -0500
committerdoy <doy@tozt.net>2009-04-14 22:58:34 -0500
commiteb7ad4a5316649951e20c8df7e734f309e07e595 (patch)
tree412f059e78ca39a1c4e88d51bc55f4b3ef6eb888 /lib
parentcc0cc84d8563e2b801926e9a34e26dd5fd81810f (diff)
downloadmoosex-nonmoose-eb7ad4a5316649951e20c8df7e734f309e07e595.tar.gz
moosex-nonmoose-eb7ad4a5316649951e20c8df7e734f309e07e595.zip
stop using Moose::extends
Diffstat (limited to 'lib')
-rw-r--r--lib/MooseX/NonMoose.pm11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/MooseX/NonMoose.pm b/lib/MooseX/NonMoose.pm
index 778adf8..488e5e5 100644
--- a/lib/MooseX/NonMoose.pm
+++ b/lib/MooseX/NonMoose.pm
@@ -8,17 +8,16 @@ Moose::Exporter->setup_import_methods(
sub extends {
my $caller = shift;
- my @superclasses = @_;
+ Moose->throw_error("Must derive at least one class") unless @_;
+
+ my @superclasses = @_;
push @superclasses, 'Moose::Object'
unless grep { $_->isa('Moose::Object') } @superclasses;
- # XXX: should move the validation out of Moose::extends and into
- # MMC::superclasses, and then just call that directly. will still need to
- # check that @_ isn't empty in that case.
- Moose::extends($caller, @superclasses);
+ my $caller_meta = Moose::Meta::Class->initialize($caller);
+ $caller_meta->superclasses(@superclasses);
- my $caller_meta = Class::MOP::Class->initialize($caller);
# we need to get the non-moose constructor from the superclass
# of the class where this method actually exists, regardless of what class
# we're calling it on