[Bast-commits] r4943 - in
Devel-Declare/1.000/branches/hooks_op_endofscope: . lib/Devel t
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Sun Oct 19 08:53:54 BST 2008
Author: rafl
Date: 2008-10-19 08:53:54 +0100 (Sun, 19 Oct 2008)
New Revision: 4943
Modified:
Devel-Declare/1.000/branches/hooks_op_endofscope/Makefile.PL
Devel-Declare/1.000/branches/hooks_op_endofscope/lib/Devel/Declare.pm
Devel-Declare/1.000/branches/hooks_op_endofscope/t/method-no-semi.t
Devel-Declare/1.000/branches/hooks_op_endofscope/t/statement.t
Log:
Use B::Hooks::EndOfScope instead of %^H and Scope::Guard.
Modified: Devel-Declare/1.000/branches/hooks_op_endofscope/Makefile.PL
===================================================================
--- Devel-Declare/1.000/branches/hooks_op_endofscope/Makefile.PL 2008-10-19 07:52:46 UTC (rev 4942)
+++ Devel-Declare/1.000/branches/hooks_op_endofscope/Makefile.PL 2008-10-19 07:53:54 UTC (rev 4943)
@@ -7,7 +7,7 @@
requires 'Scalar::Util';
build_requires 'Test::More';
-build_requires 'Scope::Guard';
+build_requires 'B::Hooks::EndOfScope';
postamble(<<'EOM');
$(OBJECT) : stolen_chunk_of_toke.c
Modified: Devel-Declare/1.000/branches/hooks_op_endofscope/lib/Devel/Declare.pm
===================================================================
--- Devel-Declare/1.000/branches/hooks_op_endofscope/lib/Devel/Declare.pm 2008-10-19 07:52:46 UTC (rev 4942)
+++ Devel-Declare/1.000/branches/hooks_op_endofscope/lib/Devel/Declare.pm 2008-10-19 07:53:54 UTC (rev 4943)
@@ -290,13 +290,13 @@
=head1 SYNOPSIS
use Devel::Declare ();
- use Scope::Guard;
{
package MethodHandlers;
use strict;
use warnings;
+ use B::Hooks::EndOfScope;
our ($Declarator, $Offset);
@@ -391,13 +391,12 @@
}
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);
- });
+ };
}
}
Modified: Devel-Declare/1.000/branches/hooks_op_endofscope/t/method-no-semi.t
===================================================================
--- Devel-Declare/1.000/branches/hooks_op_endofscope/t/method-no-semi.t 2008-10-19 07:52:46 UTC (rev 4942)
+++ Devel-Declare/1.000/branches/hooks_op_endofscope/t/method-no-semi.t 2008-10-19 07:53:54 UTC (rev 4943)
@@ -1,11 +1,11 @@
use Devel::Declare ();
-use Scope::Guard;
{
package MethodHandlers;
use strict;
use warnings;
+ use B::Hooks::EndOfScope;
our ($Declarator, $Offset);
@@ -100,13 +100,12 @@
}
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);
- });
+ };
}
}
Modified: Devel-Declare/1.000/branches/hooks_op_endofscope/t/statement.t
===================================================================
--- Devel-Declare/1.000/branches/hooks_op_endofscope/t/statement.t 2008-10-19 07:52:46 UTC (rev 4942)
+++ Devel-Declare/1.000/branches/hooks_op_endofscope/t/statement.t 2008-10-19 07:53:54 UTC (rev 4943)
@@ -1,12 +1,12 @@
use Devel::Declare ();
use Test::More qw(no_plan);
-use Scope::Guard;
{
package FoomHandlers;
use strict;
use warnings;
+ use B::Hooks::EndOfScope;
our ($Declarator, $Offset);
@@ -80,13 +80,12 @@
}
sub inject_scope {
- $^H |= 0x120000;
- $^H{DD_FOOMHANDLERS} = 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);
- });
+ };
}
package Foo;
More information about the Bast-commits
mailing list