SimonGAndrews / xstate-fsmPlus-Espruino

Fork of the FSM finite state machine package in the XState library from STATELY Ai, to enable the FSM to be run as a module within the Espruino JavaScript Interpreter for Microcontrollers. Providing enhancements to enable some basic StateChart features to be supported (eg nested states).
MIT License
0 stars 0 forks source link

Esprunio does not support JS const assign to array #5

Closed SimonGAndrews closed 2 years ago

SimonGAndrews commented 2 years ago

image

above error occurs when executing \test\espruino\test_basicmachine.js

SimonGAndrews commented 2 years ago

Investigation showed a construct such as this fails in a similiar way on Esprunio image

SimonGAndrews commented 2 years ago

The occurrance here of the issue is in a complex functional assignment, so avoiding changing the right hand side ot the assignment. The change will be to add an intermediate array variable to left hand side and then pick out elements with new seperate element assignments. Seems best option to maintin original functionality with minimum rewrite whilst maintianing variable names for clarity.

image

Change passes regression test and now executes in Espruino.