From: Tomas Doran Date: Sun, 16 Nov 2008 17:56:58 +0000 (+0000) Subject: Add a comment as per the traits case X-Git-Tag: 0.62~28 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=816208bcb744720b99939f7913f7dd1cc29976dc;p=gitmo%2FMoose.git Add a comment as per the traits case --- diff --git a/lib/Moose/Exporter.pm b/lib/Moose/Exporter.pm index 5e66910..b525ea3 100644 --- a/lib/Moose/Exporter.pm +++ b/lib/Moose/Exporter.pm @@ -246,6 +246,9 @@ sub _make_import_sub { my $did_init_meta; for my $c ( grep { $_->can('init_meta') } $class, @{$exports_from} ) { + # init_meta can apply a role, which when loaded uses + # Moose::Exporter, which in turn sets $CALLER, so we need + # to protect against that. local $CALLER = $CALLER; $c->init_meta( for_class => $CALLER ); $did_init_meta = 1;