+use strict;
+use warnings;
use Devel::Declare ();
-use Scope::Guard;
{
package MethodHandlers;
use strict;
use warnings;
+ use B::Hooks::EndOfScope;
our ($Declarator, $Offset);
}
sub inject_scope {
- $^H |= 0x120000;
- $^H{DD_METHODHANDLERS} = Scope::Guard->new(sub {
+ on_scope_end {
my $linestr = Devel::Declare::get_linestr;
my $offset = Devel::Declare::get_linestr_offset;
substr($linestr, $offset, 0) = ';';
Devel::Declare::set_linestr($linestr);
- });
+ };
}
}
}
-use Test::More 'no_plan';
+use Test::More;
my $o = DeclareTest->new(attr => "value");
is($o->$test_method2('this'), 'DeclareTest2, this', 'anon method with proto ok');
is_deeply([ map { $_->() } @test_list ], [ 1, 2, 3, 4], 'binding ok');
+
+done_testing;