From f1c31c527b5fd97a0d6c39c815e40a37674881ca Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 29 Oct 2011 19:56:18 -0700 Subject: Forbid source filters in Unicode evals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Source filters have always been byte-level filters. Therefore they don’t make sense on Unicode strings, unless we are planning to add new APIs to support it. Until then, croak. --- ext/XS-APItest/t/eval-filter.t | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/XS-APItest/t/eval-filter.t b/ext/XS-APItest/t/eval-filter.t index 8d370e59a7..d4a9153613 100644 --- a/ext/XS-APItest/t/eval-filter.t +++ b/ext/XS-APItest/t/eval-filter.t @@ -1,9 +1,18 @@ #!perl -w use strict; -use Test::More tests => 1; +use Test::More tests => 3; use XS::APItest; +{ + use feature "unicode_eval"; + my $unfiltered_foo = "foo"; + eval "BEGIN { filter() }"; + like $@, qr/^Source filters apply only to byte streams at /, + 'filters die under unicode_eval'; + is "foo", $unfiltered_foo, 'filters leak not out of unicode evals'; +} + BEGIN { eval "BEGIN{ filter() }" } is "foo", "fee", "evals share filters with the currently compiling scope"; -- cgit v1.2.1