@@ -222,9 +222,6 @@ class Perl6::World is HLL::World {
222
222
has $ ! the_whatever ;
223
223
has $ ! the_hyper_whatever ;
224
224
225
- # List of CHECK blocks to run.
226
- has @ ! CHECKs ;
227
-
228
225
# Clean-up tasks, to do after CHECK time.
229
226
has @ ! cleanup_tasks ;
230
227
@@ -237,7 +234,6 @@ class Perl6::World is HLL::World {
237
234
@ ! CODES := [];
238
235
@ ! stub_check := [];
239
236
@ ! protos_to_sort := [];
240
- @ ! CHECKs := [];
241
237
% ! sub_id_to_code_object := {};
242
238
% ! sub_id_to_cloned_code_objects := {};
243
239
% ! sub_id_to_sc_idx := {};
@@ -482,14 +478,6 @@ class Perl6::World is HLL::World {
482
478
$ ! the_hyper_whatever := $ hyper_whatever
483
479
}
484
480
485
- method add_check ($ check ) {
486
- @ ! CHECKs := [] unless @ ! CHECKs ;
487
- @ ! CHECKs . unshift ($ check );
488
- }
489
-
490
- method checks () {
491
- @ ! CHECKs
492
- }
493
481
}
494
482
495
483
method context_class () {
@@ -521,12 +509,16 @@ class Perl6::World is HLL::World {
521
509
has $ ! setting_name ;
522
510
has $ ! setting_revision ;
523
511
512
+ # List of CHECK blocks to run.
513
+ has @ ! CHECKs ;
514
+
524
515
method BUILD (* % adv ) {
525
516
% ! code_object_fixup_list := {};
526
517
$ ! record_precompilation_dependencies := 1 ;
527
518
% ! quote_lang_cache := {};
528
519
$ ! setting_loaded := 0 ;
529
520
$ ! in_unit_parse := 0 ;
521
+ @ ! CHECKs := [];
530
522
}
531
523
532
524
method create_nested () {
@@ -551,6 +543,15 @@ class Perl6::World is HLL::World {
551
543
$ ! in_unit_parse
552
544
}
553
545
546
+ method add_check ($ check ) {
547
+ @ ! CHECKs := [] unless @ ! CHECKs ;
548
+ @ ! CHECKs . unshift ($ check );
549
+ }
550
+
551
+ method checks () {
552
+ @ ! CHECKs
553
+ }
554
+
554
555
method ! check-version-modifier ($ ver-match , $ rev , $ modifier , $ comp ) {
555
556
my % lang_rev := $ comp . language_revisions;
556
557
@@ -4309,7 +4310,7 @@ class Perl6::World is HLL::World {
4309
4310
self . handle-begin-time-exceptions($/ , ' evaluating a CHECK' , $ block );
4310
4311
}
4311
4312
my $ result_node := QAST ::Stmt. new ( QAST ::Var. new ( : name(' Nil' ), : scope(' lexical' ) ) );
4312
- self . context () . add_check([$ handled_block , $ result_node ]);
4313
+ self . add_check([$ handled_block , $ result_node ]);
4313
4314
return $ result_node ;
4314
4315
}
4315
4316
elsif $ phaser eq ' INIT' {
@@ -4411,7 +4412,7 @@ class Perl6::World is HLL::World {
4411
4412
4412
4413
# Runs the CHECK phasers and twiddles the QAST to look them up.
4413
4414
method CHECK () {
4414
- for self . context () . checks() {
4415
+ for self . checks() {
4415
4416
my $ result := $ _ [0 ]();
4416
4417
$ _ [1 ][0 ] := self . add_constant_folded_result($ result );
4417
4418
}
0 commit comments