• The issue is the emulator is single-threaded

    Ah, that explains why everything halts on entering debugger into the interactive console.

    As for the example:

    DEBUG: emu.tx print(process.memory().usage)
    
    < 
    < 158
    < =undefined
    DEBUG: getSanitizedLastLine: =undefined
    > CURRENT MEMORY USAGE NaN
    DEBUG: emu.tx print(process.memory().usage)
    
    < 135
    DEBUG: getSanitizedLastLine: 135
    > CURRENT MEMORY USAGE 135
    < 135
    > CURRENT MEMORY USAGE 135
    

    The first time there is an =undefined ending up in the last stored line and that is then parsed instead of the 158 the line before. The code sent to the emulator is identical in both cases as the DEBUG: lines show.
    The emulator in the web IDE does this too and always so it probably isn't a race but something funky with storing the last line? Maybe a stray \r or something like that...

About

Avatar for halemmerich @halemmerich started