I am working on a migration platform for transferring web applications from device to another. I am expanding it to add support for maintaining state of JavaScript. My main task is to create a file representing the current state of the executable application, transfer it to another device and reboot the state of the target device.
The main decision I made was to move the window object and save all its descendant properties using JSON as the base format for exporting and expanding it to implement some functions:
- saving the reference to the object, even if it is circular (dojox.json.ref library)
- timer support
- the date
- non-numeric array properties
- reference to DOM elements
The most important task that I now need to solve is the export of closures. At this moment, I did not know how to implement this function. I read about the EcmaScript internal property [[scope]], which contains a whole chain of functions, a list-like object consisting of the entire nested function activation context. Sorry, JavaScript is not available. Does anyone know if there is a way to directly access a property [[scope]]? Or another way to keep the closing state?
source
share