I have found a way to implement a command for opening an interactive console. It "works" with the current state of the pull request alone with three major gotchas:
Do you think the changes in core and IDE would have unwanted side effects elsewhere?
There seems to be a race condition somewhere that causes the result of the call (=undefined) and what is printed by the call to switch position. That causes occasional test failures. Do you have an idea how to get to the bottom of that problem?
The demo app/test has saveMemoryUsage twice since more often than not the first one produces NaN because of this issue. Second one seems to always work somehow.
The race seems to happening independently of the changes in core/IDE.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I have found a way to implement a command for opening an interactive console. It "works" with the current state of the pull request alone with three major gotchas:
1 and 2 work with these two changes:
https://github.com/espruino/EspruinoWebIDE/compare/master...halemmerich:EspruinoWebIDE:emulator
https://github.com/espruino/EspruinoAppLoaderCore/compare/master...halemmerich:EspruinoAppLoaderCore:emulator
Do you think the changes in core and IDE would have unwanted side effects elsewhere?
There seems to be a race condition somewhere that causes the result of the call (
=undefined
) and what is printed by the call to switch position. That causes occasional test failures. Do you have an idea how to get to the bottom of that problem?The demo app/test has
saveMemoryUsage
twice since more often than not the first one producesNaN
because of this issue. Second one seems to always work somehow.The race seems to happening independently of the changes in core/IDE.