diff options
author | Brian Fraser <fraserbn@gmail.com> | 2013-03-24 05:58:43 -0300 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2013-06-28 14:53:12 +1000 |
commit | fdf416b69a0b2fb8449bc55e1bf521f3b628b511 (patch) | |
tree | 7b2d54f3bfd32b9b969c8ec06144753282c96d68 /t/op | |
parent | 8a7bc8629c40af6e31e59098eacf1dfd8eb02414 (diff) | |
download | perl-fdf416b69a0b2fb8449bc55e1bf521f3b628b511.tar.gz |
pad.c, S_cv_clone: Maintain the utf8-ness of the cloned cv
Because of a missing SvUTF8_on() in cv_clone(), these two were different:
use utf8;
eval " sub foo ($;\x{30cd});"
eval "my sub foo ($;\x{30cd});"
Because the lexical version would lose the UTF8 flag in the
prototype.
Diffstat (limited to 't/op')
-rw-r--r-- | t/op/lexsub.t | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/t/op/lexsub.t b/t/op/lexsub.t index 0141399020..c77b2ff0a4 100644 --- a/t/op/lexsub.t +++ b/t/op/lexsub.t @@ -8,7 +8,7 @@ BEGIN { *bar::like = *like; } no warnings 'deprecated'; -plan 136; +plan 137; # -------------------- Errors with feature disabled -------------------- # @@ -428,6 +428,10 @@ package main; my sub me ($); is prototype eval{\&me}, '$', 'my sub with proto'; is prototype "me", undef, 'prototype "..." ignores my subs'; + + my $coderef = eval "my sub foo (\$\x{30cd}) {1}; \\&foo"; + my $proto = prototype $coderef; + ok(utf8::is_utf8($proto), "my sub with UTF8 proto maintains the UTF8ness"); } { my sub if() { 44 } |