our $CALLER;
sub _make_wrapped_sub {
- shift;
+ my $self = shift;
my $fq_name = shift;
my $sub = shift;
my $export_recorder = shift;
return sub {
my $caller = $CALLER;
- my $sub
- = Class::MOP::subname( $fq_name => sub { $sub->( $caller, @_ ) } );
+ my $wrapper = $self->_make_wrapper($caller, $sub, $fq_name);
+
+ my $sub = Class::MOP::subname($fq_name => $wrapper);
$export_recorder->{$sub} = 1;
};
}
+sub _make_wrapper {
+ shift;
+ my $caller = shift;
+ my $sub = shift;
+ my $fq_name = shift;
+
+ return sub { $sub->($caller, @_) };
+}
+
sub _make_import_sub {
shift;
my $exporting_package = shift;