@@ -10,6 +10,7 @@ our $VERSION = '0.025';
10
10
use 5.020; # for unicode_strings, signatures, postderef features
11
11
use stable 0.031 ' postderef' ;
12
12
use experimental 0.026 qw( signatures args_array_with_signatures) ;
13
+ no autovivification warn => qw( fetch store exists delete) ;
13
14
use if " $] " >= 5.022, experimental => ' re_strict' ;
14
15
no if " $] " >= 5.031009, feature => ' indirect' ;
15
16
no if " $] " >= 5.033001, feature => ' multidimensional' ;
@@ -146,10 +147,13 @@ sub _eval_subschema ($data, $schema, $state) {
146
147
# if any of them are absolute prefix of this schema location, we are in a loop.
147
148
my $canonical_uri = canonical_uri($state );
148
149
my $schema_location = $state -> {traversed_schema_path }.$state -> {schema_path };
149
- abort($state , ' EXCEPTION: infinite loop detected (same location evaluated twice)' )
150
- if grep substr ($schema_location , 0, length ) eq $_ ,
151
- keys $state -> {seen }{$state -> {data_path }}{$canonical_uri }-> %*;
152
- $state -> {seen }{$state -> {data_path }}{$canonical_uri }{$schema_location }++;
150
+ {
151
+ use autovivification qw( fetch store) ;
152
+ abort($state , ' EXCEPTION: infinite loop detected (same location evaluated twice)' )
153
+ if grep substr ($schema_location , 0, length ) eq $_ ,
154
+ keys $state -> {seen }{$state -> {data_path }}{$canonical_uri }-> %*;
155
+ $state -> {seen }{$state -> {data_path }}{$canonical_uri }{$schema_location }++;
156
+ }
153
157
154
158
my $schema_type = get_type($schema );
155
159
return $schema || E($state , ' subschema is false' ) if $schema_type eq ' boolean' ;
@@ -211,7 +215,7 @@ sub _eval_subschema ($data, $schema, $state) {
211
215
}
212
216
213
217
# check for previously-supported but now removed keywords
214
- foreach my $keyword (sort keys $removed_keywords {$spec_version }-> %*) {
218
+ foreach my $keyword (sort keys (( $removed_keywords {$spec_version }//{}) -> %*) ) {
215
219
next if not exists $schema -> {$keyword };
216
220
my $message =' no-longer-supported "' .$keyword .' " keyword present (at location "'
217
221
.canonical_uri($state ).' ")' ;
0 commit comments