summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2012-03-22 17:58:14 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-03-22 20:23:54 -0700
commit3c54b17ac754f03829f63c4ed668e555e98f7623 (patch)
treefa1b3042bba024bea92d5f4500082add9b221cb5
parent02571fe88c6515651a3a02e3a3903a559e55be7a (diff)
downloadperl-3c54b17ac754f03829f63c4ed668e555e98f7623.tar.gz
toke.c: 'No such class %s' cleanup.
-rw-r--r--t/uni/parser.t11
-rw-r--r--toke.c2
2 files changed, 11 insertions, 2 deletions
diff --git a/t/uni/parser.t b/t/uni/parser.t
index f142edb609..a3e3477d9d 100644
--- a/t/uni/parser.t
+++ b/t/uni/parser.t
@@ -7,7 +7,7 @@ BEGIN {
require './test.pl';
}
-plan (tests => 38);
+plan (tests => 41);
use utf8;
use open qw( :utf8 :std );
@@ -108,3 +108,12 @@ is ${"main::\345\225\217"}, undef, "..and using the encoded form doesn't";
is $@, 'Unrecognized character \x{1f42a}; marked by <-- HERE after my $ニ <-- HERE near column 8 at (eval 11) line 1.
', "'Unrecognized character' croak is UTF-8 clean";
}
+
+{
+ use feature 'state';
+ for ( qw( my state our ) ) {
+ local $@;
+ eval "$_ Foo $x = 1;";
+ like $@, qr/No such class Foo/u, "'No such class' warning for $_ is UTF-8 clean";
+ }
+} \ No newline at end of file
diff --git a/toke.c b/toke.c
index 6a7e1efe45..2fb0a56a0d 100644
--- a/toke.c
+++ b/toke.c
@@ -7675,7 +7675,7 @@ Perl_yylex(pTHX)
char tmpbuf[1024];
PL_bufptr = s;
my_snprintf(tmpbuf, sizeof(tmpbuf), "No such class %.1000s", PL_tokenbuf);
- yyerror(tmpbuf);
+ yyerror_pv(tmpbuf, UTF ? SVf_UTF8 : 0);
}
#ifdef PERL_MAD
if (PL_madskills) { /* just add type to declarator token */