• Everything is saved that you'd expect if you took a 'snapshot' of memory... So:

    function foo(a) {
      setTimeout(function() {
        console.log(a);
      }, 1000);
    }
    
    foo(42);
    save();
    

    will print '42' the next time around, even if it's not global.

    The one 'gotcha' is that save() is executed when the interpreter is idle, so:

    function foo() {
      console.log("Hello");
      save();
      console.log("World");
    }
    

    Will print 'Hello', then 'World', then it will save the state.

    It's probably not a nightmare to run Espruino bare-metal on the Pi, but the second you want USB/Ethernet/Video/Sound/etc it's going to turn into an enormous amount of work :)

About

Avatar for Gordon @Gordon started