diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-04-23 20:29:13 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-05-21 16:51:34 -0700 |
commit | 09fb282d08ec6c0189a10f94933ae9c8b8186577 (patch) | |
tree | f14564b5856183a9cc59a306dd19105ec808ef9d /ext/XS-APItest | |
parent | e33525913afb6ff03f7a9e1f9881fd5ea6982f22 (diff) | |
download | perl-09fb282d08ec6c0189a10f94933ae9c8b8186577.tar.gz |
Copy call checker when cloning closure prototype
Otherwise cv_set_call_checker has no effect inside an attribute han-
dler for a closure.
Diffstat (limited to 'ext/XS-APItest')
-rw-r--r-- | ext/XS-APItest/t/call_checker.t | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ext/XS-APItest/t/call_checker.t b/ext/XS-APItest/t/call_checker.t index 51dbc939a4..429cea6b9b 100644 --- a/ext/XS-APItest/t/call_checker.t +++ b/ext/XS-APItest/t/call_checker.t @@ -1,6 +1,6 @@ use warnings; use strict; -use Test::More tests => 64; +use Test::More tests => 67; use XS::APItest; @@ -158,4 +158,15 @@ is $@, ""; is_deeply $foo_got, undef; is $foo_ret, 9; +sub MODIFY_CODE_ATTRIBUTES { cv_set_call_checker_lists($_[1]); () } +BEGIN { + *foo2 = sub($$) :Attr { $foo_got = [ @_ ]; return "z"; }; +} + +$foo_got = undef; +eval q{$foo_ret = foo2(@b, @c);}; +is $@, ""; +is_deeply $foo_got, [ qw(a b), qw(a b c) ]; +is $foo_ret, "z"; + 1; |