New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] B::Deparse doesnt handle warnings register properly. #7915
Comments
From @demerphqCreated by @demerphqB:Deparse doesnt rending warnings neatly when warnings::register is package B::Deparse::Wrapper; package main; Perl Info
|
From @demerphq--- lib\b\Deparse.pm.orig 2005-05-05 16:55:42.000000000 +0200 sub declare_warnings { |
From @demerphqOn 18 May 2005 08:30:44 -0000, via RT yves orton
Im just curious if there is a problem with the patch I included? Cheers, -- |
From ams@wiw.orgAt 2005-05-18 08:30:44 -0000, perlbug-followup@perl.org wrote:
Thanks, applied. (#24505) Could you submit your test case as a patch to ext/B/t/deparse.t, please? -- ams |
The RT System itself - Status changed from 'new' to 'open' |
From @demerphqOn 5/19/05, Abhijit Menon-Sen <ams@wiw.org> wrote:
Hi, deparse.t patch attached. Sorry about the delay. -- |
From @demerphqdeparse_t.patch--- live_orig\ext\B\t\deparse.t 2004-12-29 13:28:45.000000000 +0100
+++ live\ext\B\t\deparse.t 2005-05-23 11:41:41.578125000 +0200
@@ -24,7 +24,7 @@
use strict;
use Config;
-print "1..37\n";
+print "1..39\n";
use B::Deparse;
my $deparse = B::Deparse->new() or print "not ";
@@ -130,6 +130,37 @@
print "# [$a]\n\# vs expected\n# [$b]\nnot " if $a ne $b;
print "ok " . $i++ . "\n";
+#Re: perlbug #35857, patch #24505
+#handle warnings::register-ed packages properly.
+package B::Deparse::Wrapper;
+use strict;
+use warnings;
+use warnings::register;
+sub getcode {
+ my $deparser=B::Deparse->new();
+ return $deparser->coderef2text(shift);
+}
+
+package main;
+use strict;
+use warnings;
+sub test {
+ my $val=shift;
+ my $res=B::Deparse::Wrapper::getcode($val);
+ print $res=~/use warnings/ ? '' : 'not ',"ok\n";
+}
+my ($q,$p);
+my $x=sub { ++$q,++$p };
+test($x);
+eval <<EOFCODE and test($x);
+ package bar;
+ use strict;
+ use warnings;
+ use warnings::register;
+ package main;
+ 1
+EOFCODE
+
__DATA__
# 2
1;
|
From @rgsdemerphq wrote:
Thanks, applied as 24559 to bleadperl. |
From @smpeters
Great! Closed since patches were applied. |
@smpeters - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#35857 (status was 'resolved')
Searchable as RT35857$
The text was updated successfully, but these errors were encountered: