@@ -948,7 +948,7 @@ package Perlito5::AST::Var;
948
948
# $s = $s . ' || (' . $s . ' = new p5Array([]))'; # init
949
949
# $s = 'p5pkg[' . $s . ', "' . $self->{namespace} . '"]["' . $table->{$sigil} . $str_name . '"]';
950
950
# if ( $self->{sigil} eq '@' && $wantarray eq 'scalar' ) {
951
- # $s .= '._array_.length ';
951
+ # $s .= '.FETCHSIZE() ';
952
952
# }
953
953
# }
954
954
# elsif ($sigil eq '%') {
@@ -957,20 +957,20 @@ package Perlito5::AST::Var;
957
957
# }
958
958
959
959
# if ($self->{sigil} eq '$#') {
960
- # return '(' . $s . '._array_.length - 1)';
960
+ # return '(' . $s . '.FETCHSIZE() - 1)';
961
961
# }
962
962
# return $s;
963
963
}
964
964
}
965
965
966
966
if ( $self -> {sigil } eq ' @' ) {
967
967
if ( $wantarray eq ' scalar' ) {
968
- return $self -> emit_javascript3($level , ' list' ) . ' ._array_.length ' ;
968
+ return $self -> emit_javascript3($level , ' list' ) . ' .FETCHSIZE() ' ;
969
969
}
970
970
if ( $wantarray eq ' runtime' ) {
971
971
return ' (p5want'
972
972
. ' ? ' . $self -> emit_javascript3($level , ' list' )
973
- . ' : ' . $self -> emit_javascript3($level , ' list' ) . ' ._array_.length '
973
+ . ' : ' . $self -> emit_javascript3($level , ' list' ) . ' .FETCHSIZE() '
974
974
. ' )' ;
975
975
}
976
976
}
@@ -987,7 +987,7 @@ package Perlito5::AST::Var;
987
987
my $s = ' p5pkg["' . ($self -> {namespace } || $decl -> {namespace }) . ' "]["' . $table -> {$sigil } . $str_name . ' "]' ;
988
988
989
989
if ($self -> {sigil } eq ' $#' ) {
990
- return ' (' . $s . ' ._array_.length - 1)' ;
990
+ return ' (' . $s . ' .FETCHSIZE() - 1)' ;
991
991
}
992
992
return $s ;
993
993
}
@@ -999,7 +999,7 @@ package Perlito5::AST::Var;
999
999
{
1000
1000
# this is an undeclared global
1001
1001
if ($self -> {sigil } eq ' $#' ) {
1002
- return ' (p5global("@", "' . $self -> {namespace } . ' ", "' . $str_name . ' ")._array_.length - 1)' ;
1002
+ return ' (p5global("@", "' . $self -> {namespace } . ' ", "' . $str_name . ' ").FETCHSIZE() - 1)' ;
1003
1003
}
1004
1004
return ' p5global("' . $self -> {sigil } . ' ", "' . $self -> {namespace } . ' ", "' . $str_name . ' ")' ;
1005
1005
}
@@ -1012,7 +1012,7 @@ package Perlito5::AST::Var;
1012
1012
}
1013
1013
1014
1014
if ($self -> {sigil } eq ' $#' ) {
1015
- return ' (' . $ns . $table -> {' @' } . $str_name . ' ._array_.length - 1)' ;
1015
+ return ' (' . $ns . $table -> {' @' } . $str_name . ' .FETCHSIZE() - 1)' ;
1016
1016
}
1017
1017
1018
1018
$ns . $table -> {$self -> {sigil }} . $str_name
@@ -1367,7 +1367,7 @@ package Perlito5::AST::Apply;
1367
1367
my $self = $_ [0];
1368
1368
my $level = $_ [1];
1369
1369
my $arg = $self -> {arguments }-> [0];
1370
- ' (' . Perlito5::Javascript3::emit_javascript3_autovivify( $arg , $level , ' array' ) . ' .aderef()._array_.length - 1)' ;
1370
+ ' (' . Perlito5::Javascript3::emit_javascript3_autovivify( $arg , $level , ' array' ) . ' .aderef().FETCHSIZE() - 1)' ;
1371
1371
},
1372
1372
' prefix:<%>' => sub {
1373
1373
my $self = $_ [0];
0 commit comments