File tree Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -1666,7 +1666,6 @@ const EasyCoder_Core = {
1666
1666
const symbol = program . getSymbolRecord ( command . symbol ) ;
1667
1667
const oldCount = symbol . elements ;
1668
1668
symbol . elements = program . getValue ( command . value ) ;
1669
- symbol . index = 0 ;
1670
1669
if ( symbol . elements > oldCount ) {
1671
1670
for ( var n = oldCount ; n < symbol . elements ; n ++ ) {
1672
1671
symbol . value . push ( { } ) ;
@@ -1676,6 +1675,9 @@ const EasyCoder_Core = {
1676
1675
symbol . value = symbol . value . slice ( 0 , symbol . elements ) ;
1677
1676
symbol . element = symbol . element . slice ( 0 , symbol . elements ) ;
1678
1677
}
1678
+ if ( symbol . index >= symbol . elements ) {
1679
+ symbol . index = symbol . elements - 1 ;
1680
+ }
1679
1681
break ;
1680
1682
case `setElement` :
1681
1683
targetRecord = program . getSymbolRecord ( command . target ) ;
Original file line number Diff line number Diff line change @@ -1666,7 +1666,6 @@ const EasyCoder_Core = {
1666
1666
const symbol = program . getSymbolRecord ( command . symbol ) ;
1667
1667
const oldCount = symbol . elements ;
1668
1668
symbol . elements = program . getValue ( command . value ) ;
1669
- symbol . index = 0 ;
1670
1669
if ( symbol . elements > oldCount ) {
1671
1670
for ( var n = oldCount ; n < symbol . elements ; n ++ ) {
1672
1671
symbol . value . push ( { } ) ;
@@ -1676,6 +1675,9 @@ const EasyCoder_Core = {
1676
1675
symbol . value = symbol . value . slice ( 0 , symbol . elements ) ;
1677
1676
symbol . element = symbol . element . slice ( 0 , symbol . elements ) ;
1678
1677
}
1678
+ if ( symbol . index >= symbol . elements ) {
1679
+ symbol . index = symbol . elements - 1 ;
1680
+ }
1679
1681
break ;
1680
1682
case `setElement` :
1681
1683
targetRecord = program . getSymbolRecord ( command . target ) ;
You can’t perform that action at this time.
0 commit comments