Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-JSON for openSUSE:Factory checked in at 2026-05-20 15:23:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-JSON (Old) and /work/SRC/openSUSE:Factory/.perl-JSON.new.1966 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-JSON" Wed May 20 15:23:40 2026 rev:33 rq:1353852 version:4.110.0 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-JSON/perl-JSON.changes 2022-10-16 16:08:54.718711964 +0200 +++ /work/SRC/openSUSE:Factory/.perl-JSON.new.1966/perl-JSON.changes 2026-05-20 15:24:10.625288982 +0200 @@ -1,0 +2,9 @@ +Sun Mar 22 06:12:45 UTC 2026 - Tina Müller <[email protected]> + +- updated to 4.110.0 (4.11) + see /usr/share/doc/packages/perl-JSON/Changes + + 4.11 2026-03-22 + - updated backportPP with JSON::PP 4.18 + +------------------------------------------------------------------- Old: ---- JSON-4.10.tar.gz New: ---- JSON-4.11.tar.gz README.md _scmsync.obsinfo build.specials.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-JSON.spec ++++++ --- /var/tmp/diff_new_pack.asCj04/_old 2026-05-20 15:24:11.173311521 +0200 +++ /var/tmp/diff_new_pack.asCj04/_new 2026-05-20 15:24:11.173311521 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-JSON # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,17 +18,25 @@ %define cpan_name JSON Name: perl-JSON -Version: 4.10 +Version: 4.110.0 Release: 0 +# 4.11 -> normalize -> 4.110.0 +%define cpan_version 4.11 License: Artistic-1.0 OR GPL-1.0-or-later Summary: JSON (JavaScript Object Notation) encoder/decoder URL: https://metacpan.org/release/%{cpan_name} -Source0: https://cpan.metacpan.org/authors/id/I/IS/ISHIGAKI/%{cpan_name}-%{version}.tar.gz +Source0: https://cpan.metacpan.org/authors/id/I/IS/ISHIGAKI/%{cpan_name}-%{cpan_version}.tar.gz Source1: cpanspec.yml +Source100: README.md BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros -Recommends: perl(JSON::XS) >= 2.34 +BuildRequires: perl(Test::More) >= 0.88 +Requires: perl(Test::More) >= 0.88 +Provides: perl(JSON) = %{version} +Provides: perl(JSON::Backend::PP) +%undefine __perllib_provides +Recommends: perl(JSON::XS) >= 2.340 %{perl_requires} %description @@ -49,7 +57,7 @@ see each backend module you use. %prep -%autosetup -n %{cpan_name}-%{version} +%autosetup -n %{cpan_name}-%{cpan_version} -p1 %build perl Makefile.PL INSTALLDIRS=vendor ++++++ JSON-4.10.tar.gz -> JSON-4.11.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-4.10/Changes new/JSON-4.11/Changes --- old/JSON-4.10/Changes 2022-10-09 02:09:43.000000000 +0200 +++ new/JSON-4.11/Changes 2026-03-22 03:57:34.000000000 +0100 @@ -1,5 +1,8 @@ Revision history for Perl extension JSON. +4.11 2026-03-22 + - updated backportPP with JSON::PP 4.18 + 4.10 2022-10-09 - updated backportPP with JSON::PP 4.12 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-4.10/META.json new/JSON-4.11/META.json --- old/JSON-4.10/META.json 2022-10-09 02:10:49.000000000 +0200 +++ new/JSON-4.11/META.json 2026-03-22 03:58:50.000000000 +0100 @@ -4,7 +4,7 @@ "Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", + "generated_by" : "ExtUtils::MakeMaker version 7.76, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], @@ -35,7 +35,8 @@ "JSON::XS" : "2.34" }, "requires" : { - "Test::More" : "0" + "Scalar::Util" : "1.08", + "Test::More" : "0.88" } } }, @@ -48,6 +49,6 @@ "url" : "https://github.com/makamaka/JSON" } }, - "version" : "4.10", - "x_serialization_backend" : "JSON version 4.10" + "version" : "4.11", + "x_serialization_backend" : "JSON version 4.11" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-4.10/META.yml new/JSON-4.11/META.yml --- old/JSON-4.10/META.yml 2022-10-09 02:10:49.000000000 +0200 +++ new/JSON-4.11/META.yml 2026-03-22 03:58:50.000000000 +0100 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' +generated_by: 'ExtUtils::MakeMaker version 7.76, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -20,9 +20,10 @@ recommends: JSON::XS: '2.34' requires: - Test::More: '0' + Scalar::Util: '1.08' + Test::More: '0.88' resources: bugtracker: https://github.com/makamaka/JSON/issues repository: https://github.com/makamaka/JSON -version: '4.10' -x_serialization_backend: 'CPAN::Meta::YAML version 0.018' +version: '4.11' +x_serialization_backend: 'CPAN::Meta::YAML version 0.020' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-4.10/Makefile.PL new/JSON-4.11/Makefile.PL --- old/JSON-4.10/Makefile.PL 2021-01-17 19:27:58.000000000 +0100 +++ new/JSON-4.11/Makefile.PL 2026-03-22 03:57:15.000000000 +0100 @@ -50,7 +50,8 @@ 'ABSTRACT_FROM' => 'lib/JSON.pm', # retrieve abstract from module 'AUTHOR' => 'Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>', 'PREREQ_PM' => { - 'Test::More' => 0, + 'Test::More' => 0.88, + 'Scalar::Util' => '1.08' }, ( $ExtUtils::MakeMaker::VERSION >= 6.3002 ? ('LICENSE' => 'perl', ) : () ), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-4.10/lib/JSON/backportPP/Boolean.pm new/JSON-4.11/lib/JSON/backportPP/Boolean.pm --- old/JSON-4.10/lib/JSON/backportPP/Boolean.pm 2022-10-09 01:56:10.000000000 +0200 +++ new/JSON-4.11/lib/JSON/backportPP/Boolean.pm 2026-03-22 03:57:15.000000000 +0100 @@ -2,8 +2,8 @@ JSON::PP::Boolean; use strict; -require overload; -local $^W; +use warnings; +use overload (); overload::unimport('overload', qw(0+ ++ -- fallback)); overload::import('overload', "0+" => sub { ${$_[0]} }, @@ -12,7 +12,7 @@ fallback => 1, ); -$JSON::backportPP::Boolean::VERSION = '4.12'; +our $VERSION = '4.18'; 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-4.10/lib/JSON/backportPP.pm new/JSON-4.11/lib/JSON/backportPP.pm --- old/JSON-4.10/lib/JSON/backportPP.pm 2022-10-09 01:55:25.000000000 +0200 +++ new/JSON-4.11/lib/JSON/backportPP.pm 2026-03-22 03:57:15.000000000 +0100 @@ -3,7 +3,7 @@ # JSON-2.0 -use 5.005; +use 5.008; use strict; use Exporter (); @@ -13,11 +13,12 @@ use JSON::backportPP::Boolean; use Carp (); +use Scalar::Util qw(blessed reftype refaddr); #use Devel::Peek; -$JSON::backportPP::VERSION = '4.12'; +$JSON::backportPP::VERSION = '4.18'; -@JSON::PP::EXPORT = qw(encode_json decode_json from_json to_json); +our @EXPORT = qw(encode_json decode_json from_json to_json); # instead of hash-access, i tried index-access for speed. # but this method is not faster than what i expected. so it will be changed. @@ -45,7 +46,6 @@ use constant P_ALLOW_UNKNOWN => 18; use constant P_ALLOW_TAGS => 19; -use constant OLD_PERL => $] < 5.008 ? 1 : 0; use constant USE_B => $ENV{PERL_JSON_PP_USE_B} || 0; use constant CORE_BOOL => defined &builtin::is_bool; @@ -77,14 +77,6 @@ allow_barekey escape_slash as_nonblessed ); - # Perl version check, Unicode handling is enabled? - # Helper module sets @JSON::PP::_properties. - if ( OLD_PERL ) { - my $helper = $] >= 5.006 ? 'JSON::backportPP::Compat5006' : 'JSON::backportPP::Compat5005'; - eval qq| require $helper |; - if ($@) { Carp::croak $@; } - } - for my $name (@xs_compati_bit_properties, @pp_bit_properties) { my $property_id = 'P_' . uc($name); @@ -121,7 +113,7 @@ } -sub decode_json { # decode +sub decode_json ($) { # decode ($JSON ||= __PACKAGE__->new->utf8)->decode(@_); } @@ -327,50 +319,21 @@ { # Convert - my $max_depth; - my $indent; - my $ascii; - my $latin1; - my $utf8; - my $space_before; - my $space_after; - my $canonical; - my $allow_blessed; - my $convert_blessed; - - my $indent_length; - my $escape_slash; - my $bignum; - my $as_nonblessed; - my $allow_tags; - - my $depth; - my $indent_count; - my $keysort; - - sub PP_encode_json { my $self = shift; my $obj = shift; - $indent_count = 0; - $depth = 0; + $self->{indent_count} = 0; + $self->{depth} = 0; my $props = $self->{PROPS}; - ($ascii, $latin1, $utf8, $indent, $canonical, $space_before, $space_after, $allow_blessed, - $convert_blessed, $escape_slash, $bignum, $as_nonblessed, $allow_tags) - = @{$props}[P_ASCII .. P_SPACE_AFTER, P_ALLOW_BLESSED, P_CONVERT_BLESSED, - P_ESCAPE_SLASH, P_ALLOW_BIGNUM, P_AS_NONBLESSED, P_ALLOW_TAGS]; - - ($max_depth, $indent_length) = @{$self}{qw/max_depth indent_length/}; - - $keysort = $canonical ? sub { $a cmp $b } : undef; + $self->{keysort} = $self->{PROPS}[P_CANONICAL] ? sub { $a cmp $b } : undef; if ($self->{sort_by}) { - $keysort = ref($self->{sort_by}) eq 'CODE' ? $self->{sort_by} - : $self->{sort_by} =~ /\D+/ ? $self->{sort_by} - : sub { $a cmp $b }; + $self->{keysort} = ref($self->{sort_by}) eq 'CODE' ? $self->{sort_by} + : $self->{sort_by} =~ /\D+/ ? $self->{sort_by} + : sub { $a cmp $b }; } encode_error("hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this)") @@ -378,7 +341,7 @@ my $str = $self->object_to_json($obj); - $str .= "\n" if ( $indent ); # JSON::XS 2.26 compatible + $str .= "\n" if ( $self->{PROPS}[P_INDENT] ); # JSON::XS 2.26 compatible return $str; } @@ -399,7 +362,7 @@ return $self->value_to_json($obj) if ( $obj->isa('JSON::PP::Boolean') ); - if ( $allow_tags and $obj->can('FREEZE') ) { + if ( $self->{PROPS}[P_ALLOW_TAGS] and $obj->can('FREEZE') ) { my $obj_class = ref $obj || $obj; $obj = bless $obj, $obj_class; my @results = $obj->FREEZE('JSON'); @@ -414,7 +377,7 @@ return '("'.$obj_class.'")['.join(',', @results).']'; } - if ( $convert_blessed and $obj->can('TO_JSON') ) { + if ( $self->{PROPS}[P_CONVERT_BLESSED] and $obj->can('TO_JSON') ) { my $result = $obj->TO_JSON(); if ( defined $result and ref( $result ) ) { if ( refaddr( $obj ) eq refaddr( $result ) ) { @@ -428,10 +391,10 @@ return $self->object_to_json( $result ); } - return "$obj" if ( $bignum and _is_bignum($obj) ); + return "$obj" if ( $self->{PROPS}[P_ALLOW_BIGNUM] and _is_bignum($obj) ); - if ($allow_blessed) { - return $self->blessed_to_json($obj) if ($as_nonblessed); # will be removed. + if ($self->{PROPS}[P_ALLOW_BLESSED]) { + return $self->blessed_to_json($obj) if ($self->{PROPS}[P_AS_NONBLESSED]); # will be removed. return 'null'; } encode_error( sprintf("encountered object '%s', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing)", $obj) @@ -452,20 +415,19 @@ my @res; encode_error("json text or perl structure exceeds maximum nesting level (max_depth set too low?)") - if (++$depth > $max_depth); + if (++$self->{depth} > $self->{max_depth}); - my ($pre, $post) = $indent ? $self->_up_indent() : ('', ''); - my $del = ($space_before ? ' ' : '') . ':' . ($space_after ? ' ' : ''); + my ($pre, $post) = $self->{PROPS}[P_INDENT] ? $self->_up_indent() : ('', ''); + my $del = ($self->{PROPS}[P_SPACE_BEFORE] ? ' ' : '') . ':' . ($self->{PROPS}[P_SPACE_AFTER] ? ' ' : ''); - for my $k ( _sort( $obj ) ) { - if ( OLD_PERL ) { utf8::decode($k) } # key for Perl 5.6 / be optimized + for my $k ( $self->__sort( $obj ) ) { push @res, $self->string_to_json( $k ) . $del . ( ref $obj->{$k} ? $self->object_to_json( $obj->{$k} ) : $self->value_to_json( $obj->{$k} ) ); } - --$depth; - $self->_down_indent() if ($indent); + --$self->{depth}; + $self->_down_indent() if ($self->{PROPS}[P_INDENT]); return '{}' unless @res; return '{' . $pre . join( ",$pre", @res ) . $post . '}'; @@ -477,19 +439,20 @@ my @res; encode_error("json text or perl structure exceeds maximum nesting level (max_depth set too low?)") - if (++$depth > $max_depth); + if (++$self->{depth} > $self->{max_depth}); - my ($pre, $post) = $indent ? $self->_up_indent() : ('', ''); + my ($pre, $post) = $self->{PROPS}[P_INDENT] ? $self->_up_indent() : ('', ''); for my $v (@$obj){ push @res, ref($v) ? $self->object_to_json($v) : $self->value_to_json($v); } - --$depth; - $self->_down_indent() if ($indent); + --$self->{depth}; + $self->_down_indent() if ($self->{PROPS}[P_INDENT]); return '[]' unless @res; - return '[' . $pre . join( ",$pre", @res ) . $post . ']'; + my $space = $pre eq '' && $self->{PROPS}[P_SPACE_AFTER] ? ' ' : ''; + return '[' . $pre . join( ",$space$pre", @res ) . $post . ']'; } sub _looks_like_number { @@ -578,20 +541,20 @@ my ($self, $arg) = @_; $arg =~ s/(["\\\n\r\t\f\b])/$esc{$1}/g; - $arg =~ s/\//\\\//g if ($escape_slash); + $arg =~ s/\//\\\//g if ($self->{PROPS}[P_ESCAPE_SLASH]); # On ASCII platforms, matches [\x00-\x08\x0b\x0e-\x1f] $arg =~ s/([^\n\t\c?[:^cntrl:][:^ascii:]])/'\\u00' . unpack('H2', $1)/eg; - if ($ascii) { - $arg = JSON_PP_encode_ascii($arg); + if ($self->{PROPS}[P_ASCII]) { + $arg = _encode_ascii($arg); } - if ($latin1) { - $arg = JSON_PP_encode_latin1($arg); + if ($self->{PROPS}[P_LATIN1]) { + $arg = _encode_latin1($arg); } - if ($utf8) { + if ($self->{PROPS}[P_UTF8]) { utf8::encode($arg); } @@ -619,36 +582,30 @@ } - sub _sort { + sub __sort { + my $self = shift; + my $keysort = $self->{keysort}; defined $keysort ? (sort $keysort (keys %{$_[0]})) : keys %{$_[0]}; } sub _up_indent { my $self = shift; - my $space = ' ' x $indent_length; + my $space = ' ' x $self->{indent_length}; my ($pre,$post) = ('',''); - $post = "\n" . $space x $indent_count; + $post = "\n" . $space x $self->{indent_count}; - $indent_count++; + $self->{indent_count}++; - $pre = "\n" . $space x $indent_count; + $pre = "\n" . $space x $self->{indent_count}; return ($pre,$post); } - sub _down_indent { $indent_count--; } - - - sub PP_encode_box { - { - depth => $depth, - indent_count => $indent_count, - }; - } + sub _down_indent { $_[0]->{indent_count}--; } } # Convert @@ -720,34 +677,6 @@ '/' => '/', ); - my $text; # json data - my $at; # offset - my $ch; # first character - my $len; # text length (changed according to UTF8 or NON UTF8) - # INTERNAL - my $depth; # nest counter - my $encoding; # json text encoding - my $is_valid_utf8; # temp variable - my $utf8_len; # utf8 byte length - # FLAGS - my $utf8; # must be utf8 - my $max_depth; # max nest number of objects and arrays - my $max_size; - my $relaxed; - my $cb_object; - my $cb_sk_object; - - my $F_HOOK; - - my $allow_bignum; # using Math::BigInt/BigFloat - my $singlequote; # loosely quoting - my $loose; # - my $allow_barekey; # bareKey - my $allow_tags; - - my $alt_true; - my $alt_false; - sub _detect_utf_encoding { my $text = shift; my @octets = unpack('C4', $text); @@ -761,25 +690,18 @@ } sub PP_decode_json { - my ($self, $want_offset); - - ($self, $text, $want_offset) = @_; + my ($self, $text, $want_offset) = @_; - ($at, $ch, $depth) = (0, '', 0); + @$self{qw/at ch depth/} = (0, '', 0); if ( !defined $text or ref $text ) { - decode_error("malformed JSON string, neither array, object, number, string or atom"); + $self->_decode_error("malformed JSON string, neither array, object, number, string or atom"); } my $props = $self->{PROPS}; - ($utf8, $relaxed, $loose, $allow_bignum, $allow_barekey, $singlequote, $allow_tags) - = @{$props}[P_UTF8, P_RELAXED, P_LOOSE .. P_ALLOW_SINGLEQUOTE, P_ALLOW_TAGS]; - - ($alt_true, $alt_false) = @$self{qw/true false/}; - - if ( $utf8 ) { - $encoding = _detect_utf_encoding($text); + if ( $self->{PROPS}[P_UTF8] ) { + my $encoding = _detect_utf_encoding($text); if ($encoding ne 'UTF-8' and $encoding ne 'unknown') { require Encode; Encode::from_to($text, $encoding, 'utf-8'); @@ -791,81 +713,84 @@ utf8::encode( $text ); } - $len = length $text; + $self->{len} = length $text; + $self->{text} = $text; - ($max_depth, $max_size, $cb_object, $cb_sk_object, $F_HOOK) - = @{$self}{qw/max_depth max_size cb_object cb_sk_object F_HOOK/}; - - if ($max_size > 1) { + if ($self->{max_size} > 1) { use bytes; my $bytes = length $text; - decode_error( + $self->_decode_error( sprintf("attempted decode of JSON text of %s bytes size, but max_size is set to %s" - , $bytes, $max_size), 1 - ) if ($bytes > $max_size); + , $bytes, $self->{max_size}), 1 + ) if ($bytes > $self->{max_size}); } - white(); # remove head white space + $self->_white(); # remove head white space - decode_error("malformed JSON string, neither array, object, number, string or atom") unless defined $ch; # Is there a first character for JSON structure? + $self->_decode_error("malformed JSON string, neither array, object, number, string or atom") unless defined $self->{ch}; # Is there a first character for JSON structure? - my $result = value(); + my $result = $self->_value(); if ( !$props->[ P_ALLOW_NONREF ] and !ref $result ) { - decode_error( + $self->_decode_error( 'JSON text must be an object or array (but found number, string, true, false or null,' . ' use allow_nonref to allow this)', 1); } - Carp::croak('something wrong.') if $len < $at; # we won't arrive here. + Carp::croak('something wrong.') if $self->{len} < $self->{at}; # we won't arrive here. - my $consumed = defined $ch ? $at - 1 : $at; # consumed JSON text length + my $consumed = defined $self->{ch} ? $self->{at} - 1 : $self->{at}; # consumed JSON text length - white(); # remove tail white space + $self->_white(); # remove tail white space return ( $result, $consumed ) if $want_offset; # all right if decode_prefix - decode_error("garbage after JSON object") if defined $ch; + $self->_decode_error("garbage after JSON object") if defined $self->{ch}; $result; } - sub next_chr { - return $ch = undef if($at >= $len); - $ch = substr($text, $at++, 1); + sub _next_chr { + my $self = shift; + return $self->{ch} = undef if($self->{at} >= $self->{len}); + $self->{ch} = substr($self->{text}, $self->{at}++, 1); } - sub value { - white(); + sub _value { + my $self = shift; + $self->_white(); + my $ch = $self->{ch}; return if(!defined $ch); - return object() if($ch eq '{'); - return array() if($ch eq '['); - return tag() if($ch eq '('); - return string() if($ch eq '"' or ($singlequote and $ch eq "'")); - return number() if($ch =~ /[0-9]/ or $ch eq '-'); - return word(); + return $self->_object() if($ch eq '{'); + return $self->_array() if($ch eq '['); + return $self->_tag() if($ch eq '('); + return $self->_string() if($ch eq '"' or ($self->{PROPS}[P_ALLOW_SINGLEQUOTE] and $ch eq "'")); + return $self->_number() if($ch =~ /[0-9]/ or $ch eq '-'); + return $self->_word(); } - sub string { + sub _string { + my $self = shift; my $utf16; my $is_utf8; - ($is_valid_utf8, $utf8_len) = ('', 0); + my $utf8_len = 0; my $s = ''; # basically UTF8 flag on - if($ch eq '"' or ($singlequote and $ch eq "'")){ + my $ch = $self->{ch}; + if($ch eq '"' or ($self->{PROPS}[P_ALLOW_SINGLEQUOTE] and $ch eq "'")){ my $boundChar = $ch; - OUTER: while( defined(next_chr()) ){ + OUTER: while( defined($ch = $self->_next_chr()) ){ if($ch eq $boundChar){ - next_chr(); + $self->_next_chr(); if ($utf16) { - decode_error("missing low surrogate character in surrogate pair"); + $self->_decode_error("missing low surrogate character in surrogate pair"); } utf8::decode($s) if($is_utf8); @@ -873,7 +798,7 @@ return $s; } elsif($ch eq '\\'){ - next_chr(); + $ch = $self->_next_chr(); if(exists $escapes{$ch}){ $s .= $escapes{$ch}; } @@ -881,7 +806,7 @@ my $u = ''; for(1..4){ - $ch = next_chr(); + $ch = $self->_next_chr(); last OUTER if($ch !~ /[0-9a-fA-F]/); $u .= $ch; } @@ -893,21 +818,21 @@ # U+DC00 - U+DFFF elsif ($u =~ /^[dD][c-fC-F][0-9a-fA-F]{2}/) { # UTF-16 low surrogate? unless (defined $utf16) { - decode_error("missing high surrogate character in surrogate pair"); + $self->_decode_error("missing high surrogate character in surrogate pair"); } $is_utf8 = 1; - $s .= JSON_PP_decode_surrogates($utf16, $u) || next; + $s .= _decode_surrogates($utf16, $u) || next; $utf16 = undef; } else { if (defined $utf16) { - decode_error("surrogate pair expected"); + $self->_decode_error("surrogate pair expected"); } my $hex = hex( $u ); if ( chr $u =~ /[[:^ascii:]]/ ) { $is_utf8 = 1; - $s .= JSON_PP_decode_unicode($u) || next; + $s .= _decode_unicode($u) || next; } else { $s .= chr $hex; @@ -916,9 +841,9 @@ } else{ - unless ($loose) { - $at -= 2; - decode_error('illegal backslash escape sequence in string'); + unless ($self->{PROPS}[P_LOOSE]) { + $self->{at} -= 2; + $self->_decode_error('illegal backslash escape sequence in string'); } $s .= $ch; } @@ -926,22 +851,22 @@ else{ if ( $ch =~ /[[:^ascii:]]/ ) { - unless( $ch = is_valid_utf8($ch) ) { - $at -= 1; - decode_error("malformed UTF-8 character in JSON string"); + unless( $ch = $self->_is_valid_utf8($ch, \$utf8_len) ) { + $self->{at} -= 1; + $self->_decode_error("malformed UTF-8 character in JSON string"); } else { - $at += $utf8_len - 1; + $self->{at} += $utf8_len - 1; } $is_utf8 = 1; } - if (!$loose) { + if (!$self->{PROPS}[P_LOOSE]) { if ($ch =~ $invalid_char_re) { # '/' ok - if (!$relaxed or $ch ne "\t") { - $at--; - decode_error(sprintf "invalid character 0x%X" + if (!$self->{PROPS}[P_RELAXED] or $ch ne "\t") { + $self->{at}--; + $self->_decode_error(sprintf "invalid character 0x%X" . " encountered while parsing JSON string", ord $ch); } @@ -953,51 +878,53 @@ } } - decode_error("unexpected end of string while parsing JSON string"); + $self->_decode_error("unexpected end of string while parsing JSON string"); } - sub white { + sub _white { + my $self = shift; + my $ch = $self->{ch}; while( defined $ch ){ if($ch eq '' or $ch =~ /\A[ \t\r\n]\z/){ - next_chr(); + $ch = $self->_next_chr(); } - elsif($relaxed and $ch eq '/'){ - next_chr(); + elsif($self->{PROPS}[P_RELAXED] and $ch eq '/'){ + $ch = $self->_next_chr(); if(defined $ch and $ch eq '/'){ - 1 while(defined(next_chr()) and $ch ne "\n" and $ch ne "\r"); + 1 while(defined($ch = $self->_next_chr()) and $ch ne "\n" and $ch ne "\r"); } elsif(defined $ch and $ch eq '*'){ - next_chr(); + $ch = $self->_next_chr(); while(1){ if(defined $ch){ if($ch eq '*'){ - if(defined(next_chr()) and $ch eq '/'){ - next_chr(); + if(defined($ch = $self->_next_chr()) and $ch eq '/'){ + $ch = $self->_next_chr(); last; } } else{ - next_chr(); + $ch = $self->_next_chr(); } } else{ - decode_error("Unterminated comment"); + $self->_decode_error("Unterminated comment"); } } next; } else{ - $at--; - decode_error("malformed JSON string, neither array, object, number, string or atom"); + $self->{at}--; + $self->_decode_error("malformed JSON string, neither array, object, number, string or atom"); } } else{ - if ($relaxed and $ch eq '#') { # correctly? - pos($text) = $at; - $text =~ /\G([^\n]*(?:\r\n|\r|\n|$))/g; - $at = pos($text); - next_chr; + if ($self->{PROPS}[P_RELAXED] and $ch eq '#') { # correctly? + pos($self->{text}) = $self->{at}; + $self->{text} =~ /\G([^\n]*(?:\r\n|\r|\n|$))/g; + $self->{at} = pos($self->{text}); + $ch = $self->_next_chr; next; } @@ -1007,33 +934,36 @@ } - sub array { + sub _array { + my $self = shift; my $a = $_[0] || []; # you can use this code to use another array ref object. - decode_error('json text or perl structure exceeds maximum nesting level (max_depth set too low?)') - if (++$depth > $max_depth); + $self->_decode_error('json text or perl structure exceeds maximum nesting level (max_depth set too low?)') + if (++$self->{depth} > $self->{max_depth}); - next_chr(); - white(); + $self->_next_chr(); + $self->_white(); + my $ch = $self->{ch}; if(defined $ch and $ch eq ']'){ - --$depth; - next_chr(); + --$self->{depth}; + $self->_next_chr(); return $a; } else { while(defined($ch)){ - push @$a, value(); + push @$a, $self->_value(); - white(); + $self->_white(); + $ch = $self->{ch}; if (!defined $ch) { last; } if($ch eq ']'){ - --$depth; - next_chr(); + --$self->{depth}; + $self->_next_chr(); return $a; } @@ -1041,90 +971,97 @@ last; } - next_chr(); - white(); + $self->_next_chr(); + $self->_white(); - if ($relaxed and $ch eq ']') { - --$depth; - next_chr(); + $ch = $self->{ch}; + if ($self->{PROPS}[P_RELAXED] and $ch eq ']') { + --$self->{depth}; + $self->_next_chr(); return $a; } } } - $at-- if defined $ch and $ch ne ''; - decode_error(", or ] expected while parsing array"); + $self->{at}-- if defined $ch and $ch ne ''; + $self->_decode_error(", or ] expected while parsing array"); } - sub tag { - decode_error('malformed JSON string, neither array, object, number, string or atom') unless $allow_tags; + sub _tag { + my $self = shift; + $self->_decode_error('malformed JSON string, neither array, object, number, string or atom') unless $self->{PROPS}[P_ALLOW_TAGS]; - next_chr(); - white(); + $self->_next_chr(); + $self->_white(); - my $tag = value(); + my $tag = $self->_value(); return unless defined $tag; - decode_error('malformed JSON string, (tag) must be a string') if ref $tag; + $self->_decode_error('malformed JSON string, (tag) must be a string') if ref $tag; - white(); + $self->_white(); + my $ch = $self->{ch}; if (!defined $ch or $ch ne ')') { - decode_error(') expected after tag'); + $self->_decode_error(') expected after tag'); } - next_chr(); - white(); + $self->_next_chr(); + $self->_white(); - my $val = value(); + my $val = $self->_value(); return unless defined $val; - decode_error('malformed JSON string, tag value must be an array') unless ref $val eq 'ARRAY'; + $self->_decode_error('malformed JSON string, tag value must be an array') unless ref $val eq 'ARRAY'; if (!eval { $tag->can('THAW') }) { - decode_error('cannot decode perl-object (package does not exist)') if $@; - decode_error('cannot decode perl-object (package does not have a THAW method)'); + $self->_decode_error('cannot decode perl-object (package does not exist)') if $@; + $self->_decode_error('cannot decode perl-object (package does not have a THAW method)'); } $tag->THAW('JSON', @$val); } - sub object { + sub _object { + my $self = shift; my $o = $_[0] || {}; # you can use this code to use another hash ref object. my $k; - decode_error('json text or perl structure exceeds maximum nesting level (max_depth set too low?)') - if (++$depth > $max_depth); - next_chr(); - white(); + $self->_decode_error('json text or perl structure exceeds maximum nesting level (max_depth set too low?)') + if (++$self->{depth} > $self->{max_depth}); + $self->_next_chr(); + $self->_white(); + my $ch = $self->{ch}; if(defined $ch and $ch eq '}'){ - --$depth; - next_chr(); - if ($F_HOOK) { - return _json_object_hook($o); + --$self->{depth}; + $self->_next_chr(); + if ($self->{F_HOOK}) { + return $self->__json_object_hook($o); } return $o; } else { while (defined $ch) { - $k = ($allow_barekey and $ch ne '"' and $ch ne "'") ? bareKey() : string(); - white(); + $k = ($self->{PROPS}[P_ALLOW_BAREKEY] and $ch ne '"' and $ch ne "'") ? $self->_bareKey() : $self->_string(); + $self->_white(); + $ch = $self->{ch}; if(!defined $ch or $ch ne ':'){ - $at--; - decode_error("':' expected"); + $self->{at}--; + $self->_decode_error("':' expected"); } - next_chr(); - $o->{$k} = value(); - white(); + $self->_next_chr(); + $o->{$k} = $self->_value(); + $self->_white(); + $ch = $self->{ch}; last if (!defined $ch); if($ch eq '}'){ - --$depth; - next_chr(); - if ($F_HOOK) { - return _json_object_hook($o); + --$self->{depth}; + $self->_next_chr(); + if ($self->{F_HOOK}) { + return $self->__json_object_hook($o); } return $o; } @@ -1133,14 +1070,15 @@ last; } - next_chr(); - white(); + $self->_next_chr(); + $self->_white(); - if ($relaxed and $ch eq '}') { - --$depth; - next_chr(); - if ($F_HOOK) { - return _json_object_hook($o); + $ch = $self->{ch}; + if ($self->{PROPS}[P_RELAXED] and $ch eq '}') { + --$self->{depth}; + $self->_next_chr(); + if ($self->{F_HOOK}) { + return $self->__json_object_hook($o); } return $o; } @@ -1149,94 +1087,99 @@ } - $at-- if defined $ch and $ch ne ''; - decode_error(", or } expected while parsing object/hash"); + $self->{at}-- if defined $ch and $ch ne ''; + $self->_decode_error(", or } expected while parsing object/hash"); } - sub bareKey { # doesn't strictly follow Standard ECMA-262 3rd Edition + sub _bareKey { # doesn't strictly follow Standard ECMA-262 3rd Edition + my $self = shift; my $key; + my $ch = $self->{ch}; while($ch =~ /[\$\w[:^ascii:]]/){ $key .= $ch; - next_chr(); + $ch = $self->_next_chr(); } return $key; } - sub word { - my $word = substr($text,$at-1,4); + sub _word { + my $self = shift; + my $word = substr($self->{text},$self->{at}-1,4); if($word eq 'true'){ - $at += 3; - next_chr; - return defined $alt_true ? $alt_true : $JSON::PP::true; + $self->{at} += 3; + $self->_next_chr; + return defined $self->{true} ? $self->{true} : $JSON::PP::true; } elsif($word eq 'null'){ - $at += 3; - next_chr; + $self->{at} += 3; + $self->_next_chr; return undef; } elsif($word eq 'fals'){ - $at += 3; - if(substr($text,$at,1) eq 'e'){ - $at++; - next_chr; - return defined $alt_false ? $alt_false : $JSON::PP::false; + $self->{at} += 3; + if(substr($self->{text},$self->{at},1) eq 'e'){ + $self->{at}++; + $self->_next_chr; + return defined $self->{false} ? $self->{false} : $JSON::PP::false; } } - $at--; # for decode_error report + $self->{at}--; # for decode_error report - decode_error("'null' expected") if ($word =~ /^n/); - decode_error("'true' expected") if ($word =~ /^t/); - decode_error("'false' expected") if ($word =~ /^f/); - decode_error("malformed JSON string, neither array, object, number, string or atom"); + $self->_decode_error("'null' expected") if ($word =~ /^n/); + $self->_decode_error("'true' expected") if ($word =~ /^t/); + $self->_decode_error("'false' expected") if ($word =~ /^f/); + $self->_decode_error("malformed JSON string, neither array, object, number, string or atom"); } - sub number { + sub _number { + my $self = shift; my $n = ''; my $v; my $is_dec; my $is_exp; + my $ch = $self->{ch}; if($ch eq '-'){ $n = '-'; - next_chr; + $ch = $self->_next_chr; if (!defined $ch or $ch !~ /\d/) { - decode_error("malformed number (no digits after initial minus)"); + $self->_decode_error("malformed number (no digits after initial minus)"); } } # According to RFC4627, hex or oct digits are invalid. if($ch eq '0'){ - my $peek = substr($text,$at,1); + my $peek = substr($self->{text},$self->{at},1); if($peek =~ /^[0-9a-dfA-DF]/){ # e may be valid (exponential) - decode_error("malformed number (leading zero must not be followed by another digit)"); + $self->_decode_error("malformed number (leading zero must not be followed by another digit)"); } $n .= $ch; - next_chr; + $ch = $self->_next_chr; } while(defined $ch and $ch =~ /\d/){ $n .= $ch; - next_chr; + $ch = $self->_next_chr; } if(defined $ch and $ch eq '.'){ $n .= '.'; $is_dec = 1; - next_chr; + $ch = $self->_next_chr; if (!defined $ch or $ch !~ /\d/) { - decode_error("malformed number (no digits after decimal point)"); + $self->_decode_error("malformed number (no digits after decimal point)"); } else { $n .= $ch; } - while(defined(next_chr) and $ch =~ /\d/){ + while(defined($ch = $self->_next_chr) and $ch =~ /\d/){ $n .= $ch; } } @@ -1244,13 +1187,13 @@ if(defined $ch and ($ch eq 'e' or $ch eq 'E')){ $n .= $ch; $is_exp = 1; - next_chr; + $ch = $self->_next_chr; if(defined($ch) and ($ch eq '+' or $ch eq '-')){ $n .= $ch; - next_chr; + $ch = $self->_next_chr; if (!defined $ch or $ch =~ /\D/) { - decode_error("malformed number (no digits after exp sign)"); + $self->_decode_error("malformed number (no digits after exp sign)"); } $n .= $ch; } @@ -1258,10 +1201,10 @@ $n .= $ch; } else { - decode_error("malformed number (no digits after exp sign)"); + $self->_decode_error("malformed number (no digits after exp sign)"); } - while(defined(next_chr) and $ch =~ /\d/){ + while(defined($ch = $self->_next_chr) and $ch =~ /\d/){ $n .= $ch; } @@ -1270,13 +1213,13 @@ $v .= $n; if ($is_dec or $is_exp) { - if ($allow_bignum) { + if ($self->{PROPS}[P_ALLOW_BIGNUM]) { require Math::BigFloat; return Math::BigFloat->new($v); } } else { if (length $v > $max_intsize) { - if ($allow_bignum) { # from Adam Sussman + if ($self->{PROPS}[P_ALLOW_BIGNUM]) { # from Adam Sussman require Math::BigInt; return Math::BigInt->new($v); } @@ -1292,19 +1235,20 @@ # Compute how many bytes are in the longest legal official Unicode # character my $max_unicode_length = do { - BEGIN { $] >= 5.006 and require warnings and warnings->unimport('utf8') } + no warnings 'utf8'; chr 0x10FFFF; }; utf8::encode($max_unicode_length); $max_unicode_length = length $max_unicode_length; - sub is_valid_utf8 { + sub _is_valid_utf8 { + my ($self, $ch, $utf8_len_r) = @_; # Returns undef (setting $utf8_len to 0) unless the next bytes in $text # comprise a well-formed UTF-8 encoded character, in which case, # return those bytes, setting $utf8_len to their count. - my $start_point = substr($text, $at - 1); + my $start_point = substr($self->{text}, $self->{at} - 1); # Look no further than the maximum number of bytes in a single # character @@ -1325,8 +1269,8 @@ # and return those bytes. $copy = substr($copy, 0, 1); utf8::encode($copy); - $utf8_len = length $copy; - return substr($start_point, 0, $utf8_len); + $$utf8_len_r = length $copy; + return substr($start_point, 0, $$utf8_len_r); } # If it didn't work, it could be that there is a full legal character @@ -1336,25 +1280,19 @@ } # Failed to find a legal UTF-8 character. - $utf8_len = 0; + $$utf8_len_r = 0; return; } - sub decode_error { + sub _decode_error { + my $self = shift; my $error = shift; my $no_rep = shift; - my $str = defined $text ? substr($text, $at) : ''; + my $str = defined $self->{text} ? substr($self->{text}, $self->{at}) : ''; my $mess = ''; my $type = 'U*'; - if ( OLD_PERL ) { - my $type = $] < 5.006 ? 'C*' - : utf8::is_utf8( $str ) ? 'U*' # 5.6 - : 'C*' - ; - } - for my $c ( unpack( $type, $str ) ) { # emulate pv_uni_display() ? my $chr_c = chr($c); $mess .= $chr_c eq '\\' ? '\\\\' @@ -1377,18 +1315,19 @@ } Carp::croak ( - $no_rep ? "$error" : "$error, at character offset $at (before \"$mess\")" + $no_rep ? "$error" : "$error, at character offset $self->{at} (before \"$mess\")" ); } - sub _json_object_hook { + sub __json_object_hook { + my $self = shift; my $o = $_[0]; my @ks = keys %{$o}; - if ( $cb_sk_object and @ks == 1 and exists $cb_sk_object->{ $ks[0] } and ref $cb_sk_object->{ $ks[0] } ) { - my @val = $cb_sk_object->{ $ks[0] }->( $o->{$ks[0]} ); + if ( $self->{cb_sk_object} and @ks == 1 and exists $self->{cb_sk_object}{ $ks[0] } and ref $self->{cb_sk_object}{ $ks[0] } ) { + my @val = $self->{cb_sk_object}{ $ks[0] }->( $o->{$ks[0]} ); if (@val == 0) { return $o; } @@ -1400,7 +1339,7 @@ } } - my @val = $cb_object->($o) if ($cb_object); + my @val = $self->{cb_object}->($o) if ($self->{cb_object}); if (@val == 0) { return $o; } @@ -1412,19 +1351,6 @@ } } - - sub PP_decode_box { - { - text => $text, - at => $at, - ch => $ch, - len => $len, - depth => $depth, - encoding => $encoding, - is_valid_utf8 => $is_valid_utf8, - }; - } - } # PARSE @@ -1442,131 +1368,35 @@ return $un; } -# -# Setup for various Perl versions (the code from JSON::PP58) -# - -BEGIN { - - unless ( defined &utf8::is_utf8 ) { - require Encode; - *utf8::is_utf8 = *Encode::is_utf8; - } - - if ( !OLD_PERL ) { - *JSON::PP::JSON_PP_encode_ascii = \&_encode_ascii; - *JSON::PP::JSON_PP_encode_latin1 = \&_encode_latin1; - *JSON::PP::JSON_PP_decode_surrogates = \&_decode_surrogates; - *JSON::PP::JSON_PP_decode_unicode = \&_decode_unicode; - - if ($] < 5.008003) { # join() in 5.8.0 - 5.8.2 is broken. - package # hide from PAUSE - JSON::PP; - require subs; - subs->import('join'); - eval q| - sub join { - return '' if (@_ < 2); - my $j = shift; - my $str = shift; - for (@_) { $str .= $j . $_; } - return $str; - } - |; - } - } +sub incr_parse { + local $Carp::CarpLevel = 1; + ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_parse( @_ ); +} - sub JSON::PP::incr_parse { - local $Carp::CarpLevel = 1; - ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_parse( @_ ); - } +sub incr_skip { + ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_skip; +} - sub JSON::PP::incr_skip { - ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_skip; - } +sub incr_reset { + ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_reset; +} +sub incr_text : lvalue { + $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new; - sub JSON::PP::incr_reset { - ( $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new )->incr_reset; + if ( $_[0]->{_incr_parser}->{incr_pos} ) { + Carp::croak("incr_text cannot be called when the incremental parser already started parsing"); } - - eval q{ - sub JSON::PP::incr_text : lvalue { - $_[0]->{_incr_parser} ||= JSON::PP::IncrParser->new; - - if ( $_[0]->{_incr_parser}->{incr_pos} ) { - Carp::croak("incr_text cannot be called when the incremental parser already started parsing"); - } - $_[0]->{_incr_parser}->{incr_text}; - } - } if ( $] >= 5.006 ); - -} # Setup for various Perl versions (the code from JSON::PP58) + $_[0]->{_incr_parser}->{incr_text}; +} ############################### # Utilities # -BEGIN { - eval 'require Scalar::Util'; - unless($@){ - *JSON::PP::blessed = \&Scalar::Util::blessed; - *JSON::PP::reftype = \&Scalar::Util::reftype; - *JSON::PP::refaddr = \&Scalar::Util::refaddr; - } - else{ # This code is from Scalar::Util. - # warn $@; - eval 'sub UNIVERSAL::a_sub_not_likely_to_be_here { ref($_[0]) }'; - *JSON::PP::blessed = sub { - local($@, $SIG{__DIE__}, $SIG{__WARN__}); - ref($_[0]) ? eval { $_[0]->a_sub_not_likely_to_be_here } : undef; - }; - require B; - my %tmap = qw( - B::NULL SCALAR - B::HV HASH - B::AV ARRAY - B::CV CODE - B::IO IO - B::GV GLOB - B::REGEXP REGEXP - ); - *JSON::PP::reftype = sub { - my $r = shift; - - return undef unless length(ref($r)); - - my $t = ref(B::svref_2object($r)); - - return - exists $tmap{$t} ? $tmap{$t} - : length(ref($$r)) ? 'REF' - : 'SCALAR'; - }; - *JSON::PP::refaddr = sub { - return undef unless length(ref($_[0])); - - my $addr; - if(defined(my $pkg = blessed($_[0]))) { - $addr .= bless $_[0], 'Scalar::Util::Fake'; - bless $_[0], $pkg; - } - else { - $addr .= $_[0] - } - - $addr =~ /0x(\w+)/; - local $^W; - #no warnings 'portable'; - hex($1); - } - } -} - - # shamelessly copied and modified from JSON::XS code. $JSON::PP::true = do { bless \(my $dummy = 1), "JSON::PP::Boolean" }; @@ -1607,7 +1437,7 @@ use constant INCR_M_TFN => 6; use constant INCR_M_NUM => 7; -$JSON::backportPP::IncrParser::VERSION = '1.01'; +$JSON::backportPP::VERSION = '1.01'; sub new { my ( $class ) = @_; @@ -1927,7 +1757,7 @@ On perl 5.36 and above, will also return true when given one of perl's standard boolean values, such as the result of a comparison. -See L<MAPPING>, below, for more information on how JSON values are mapped to +See L</MAPPING>, below, for more information on how JSON values are mapped to Perl. =head1 OBJECT-ORIENTED INTERFACE @@ -2214,7 +2044,7 @@ $enabled = $json->get_allow_nonref -Unlike other boolean options, this opotion is enabled by default beginning +Unlike other boolean options, this option is enabled by default beginning with version C<4.0>. If C<$enable> is true (or missing), then the C<encode> method can convert a @@ -2586,7 +2416,7 @@ print $json->encode($bigfloat); # => 2.000000000000000000000000001 -See also L<MAPPING>. +See also L</MAPPING>. =head2 loose @@ -2653,7 +2483,7 @@ As the sorting is done in the JSON::PP scope, you usually need to prepend C<JSON::PP::> to the subroutine name, and the special variables -C<$a> and C<$b> used in the subrontine used by C<sort> function. +C<$a> and C<$b> used in the subroutine used by C<sort> function. Example: @@ -3018,7 +2848,7 @@ constant string C<JSON> to distinguish it from other serialisers. The C<FREEZE> method can return any number of values (i.e. zero or -more). These values and the paclkage/classname of the object will then be +more). These values and the package/classname of the object will then be encoded as a tagged JSON value in the following format: ("classname")[FREEZE return values...] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-4.10/lib/JSON.pm new/JSON-4.11/lib/JSON.pm --- old/JSON-4.10/lib/JSON.pm 2022-10-09 02:09:26.000000000 +0200 +++ new/JSON-4.11/lib/JSON.pm 2026-03-22 03:58:05.000000000 +0100 @@ -9,7 +9,7 @@ @JSON::EXPORT = qw(from_json to_json jsonToObj objToJson encode_json decode_json); BEGIN { - $JSON::VERSION = '4.10'; + $JSON::VERSION = '4.11'; $JSON::DEBUG = 0 unless (defined $JSON::DEBUG); $JSON::DEBUG = $ENV{ PERL_JSON_DEBUG } if exists $ENV{ PERL_JSON_DEBUG }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-4.10/t/109_encode.t new/JSON-4.11/t/109_encode.t --- old/JSON-4.10/t/109_encode.t 2022-10-09 01:55:25.000000000 +0200 +++ new/JSON-4.11/t/109_encode.t 2026-03-22 03:57:15.000000000 +0100 @@ -9,8 +9,6 @@ BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } -my $isASCII = ord "A" == 65; - use JSON; no utf8; @@ -22,40 +20,25 @@ $json->ascii; -if ($] < 5.008) { - is($json->encode("\xb6"), q|"\u00b6"|); # latin1 +is($json->encode("\xb6"), q|"\u00b6"|); # latin1 + +if (ord "A" == 65) { is($json->encode("\xc2\xb6"), q|"\u00c2\u00b6"|); # utf8 is($json->encode("¶"), q|"\u00c2\u00b6"|); # utf8 is($json->encode('あ'), q|"\u00e3\u0081\u0082"|); } -else { - is($json->encode("\xb6"), q|"\u00b6"|); # latin1 - - if (ord "A" == 65) { - is($json->encode("\xc2\xb6"), q|"\u00c2\u00b6"|); # utf8 - is($json->encode("¶"), q|"\u00c2\u00b6"|); # utf8 - is($json->encode('あ'), q|"\u00e3\u0081\u0082"|); +else { + if (ord '^' == 95) { # EBCDIC 1047 + is($json->encode("\x80\x65"), q|"\u0080\u0065"|); # utf8 + is($json->encode("¶"), q|"\u0080\u0065"|); # utf8 } - else { - if (ord '^' == 95) { # EBCDIC 1047 - is($json->encode("\x80\x65"), q|"\u0080\u0065"|); # utf8 - is($json->encode("¶"), q|"\u0080\u0065"|); # utf8 - } - else { # Assume EBCDIC 037 - is($json->encode("\x78\x64"), q|"\u0078\u0064"|); # utf8 - is($json->encode("¶"), q|"\u0078\u0064"|); # utf8 - } - - is($json->encode('あ'), (q|"\u00ce\u0043\u0043"|)); + else { # Assume EBCDIC 037 + is($json->encode("\x78\x64"), q|"\u0078\u0064"|); # utf8 + is($json->encode("¶"), q|"\u0078\u0064"|); # utf8 } -} -if ($] >= 5.006) { - is($json->encode(chr hex 3042 ), q|"\u3042"|); - is($json->encode(chr hex 12345 ), q|"\ud808\udf45"|); -} -else { - is($json->encode(chr hex 3042 ), $json->encode(chr 66)); - is($json->encode(chr hex 12345 ), $json->encode(chr 69)); + is($json->encode('あ'), (q|"\u00ce\u0043\u0043"|)); } +is($json->encode(chr hex 3042 ), q|"\u3042"|); +is($json->encode(chr hex 12345 ), q|"\ud808\udf45"|); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-4.10/t/118_boolean_values.t new/JSON-4.11/t/118_boolean_values.t --- old/JSON-4.10/t/118_boolean_values.t 2022-10-09 01:55:25.000000000 +0200 +++ new/JSON-4.11/t/118_boolean_values.t 2026-03-22 03:57:15.000000000 +0100 @@ -4,8 +4,6 @@ BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } use JSON; -BEGIN { plan skip_all => "requires Perl 5.008 or later" if $] < 5.008 } - BEGIN { plan skip_all => "requires JSON::XS 4 compat backend" if ($JSON::BackendModulePP and eval $JSON::BackendModulePP->VERSION < 3) or ($JSON::BackendModule eq 'Cpanel::JSON::XS') or ($JSON::BackendModule eq 'JSON::XS' and $JSON::BackendModule->VERSION < 4); } package # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-4.10/t/20_faihu.t new/JSON-4.11/t/20_faihu.t --- old/JSON-4.10/t/20_faihu.t 2022-10-09 01:55:25.000000000 +0200 +++ new/JSON-4.11/t/20_faihu.t 2026-03-22 03:57:15.000000000 +0100 @@ -7,8 +7,6 @@ BEGIN { $ENV{PERL_JSON_BACKEND} ||= "JSON::backportPP"; } -BEGIN { if ($] < 5.008) { require Test::More; Test::More::plan(skip_all => "requires Perl 5.8 or later"); } }; - use JSON; use Encode qw(encode decode); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-4.10/t/20_unknown.t new/JSON-4.11/t/20_unknown.t --- old/JSON-4.10/t/20_unknown.t 2022-10-09 01:55:25.000000000 +0200 +++ new/JSON-4.11/t/20_unknown.t 2026-03-22 03:57:15.000000000 +0100 @@ -29,10 +29,6 @@ is( $json->encode( [ \{} ] ), '[null]' ); -SKIP: { - - skip "this test is for Perl 5.8 or later", 2 if( $] < 5.008 ); - $json->allow_unknown(0); my $fh; @@ -48,5 +44,3 @@ close $fh; unlink('hoge.txt'); - -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-4.10/t/e02_bool.t new/JSON-4.11/t/e02_bool.t --- old/JSON-4.10/t/e02_bool.t 2022-08-01 07:37:59.000000000 +0200 +++ new/JSON-4.11/t/e02_bool.t 2026-03-22 03:57:15.000000000 +0100 @@ -18,6 +18,8 @@ ) ? 1 : 0; my $core_bool_support = JSON->backend->can("CORE_BOOL") && JSON->backend->CORE_BOOL ? 1 : 0; +$core_bool_support = 1 if JSON->backend->isa('Cpanel::JSON::XS') && JSON->backend->VERSION >= 4.38; +$core_bool_support = 0 unless defined &builtin::is_bool; is($json->encode([!1]), $core_bool_support ? '[false]' : '[""]'); if ($not_not_a_number_is_a_number) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/JSON-4.10/t/gh_28_json_test_suite.t new/JSON-4.11/t/gh_28_json_test_suite.t --- old/JSON-4.10/t/gh_28_json_test_suite.t 2022-10-09 01:55:25.000000000 +0200 +++ new/JSON-4.11/t/gh_28_json_test_suite.t 2026-03-22 03:57:15.000000000 +0100 @@ -5,8 +5,6 @@ use warnings; use Test::More; -BEGIN { plan skip_all => 'this test is for Perl 5.8 or later' if $] < 5.008; } - BEGIN { plan tests => 20 }; BEGIN { $ENV{PERL_JSON_BACKEND} = "JSON::backportPP"; } ++++++ README.md ++++++ ## Build Results Current state of perl in openSUSE:Factory is  The current state of perl in the devel project build (devel:languages:perl)  ++++++ _scmsync.obsinfo ++++++ mtime: 1774159966 commit: b0473bcc2615bbcfe8ec3b66b7360c45440e1c83c1b8434bdfcd45e187611ab5 url: https://src.opensuse.org/perl/perl-JSON revision: b0473bcc2615bbcfe8ec3b66b7360c45440e1c83c1b8434bdfcd45e187611ab5 projectscmsync: https://src.opensuse.org/perl/_ObsPrj ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-03-22 07:12:46.000000000 +0100 @@ -0,0 +1 @@ +.osc
