Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Serializing the entire engine

0
0
So I know you can't do what the subject suggests.

What I'd like is the next best thing.

I'm trying to save as much of the running engine instance as possible so that I can re-instantiate it later and begin invoking functions. I recognize that I'm going to have to be doing something like scrapping the engine instance's root objects, saving them somehow, and then reinjecting them into the engine before resuming execution of script. So, I'm looking for two things:

1) How do I get access to all root objects from inside the CLR?
2) Any advice on things to look out for? I recognize I'm going to have it tricky with regards to tracking down and persisting references, and especially things like 'this' references in JavaScript, and function instances.

What I'm basically implementing is a W3C user agent for XForms. Imagine it as an actual web browser. Except I need to save my engine state and resume it where its left off. My implementation is basically done, except I'm looking for a suitable JavaScript engine to add into it. ClearScript is nice, but I need to be able to accomplish this.

https://github.com/nxkit/nxkit

Viewing all articles
Browse latest Browse all 2297