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

New Post: A bit more modularization

0
0
Hi Torsten,

You appear to be concerned about unrelated scripts leaving functions and other objects around, eventually leading to a cluttered and unpredictable execution environment for subsequent scripts. Is that correct?

If so, then you should definitely use separate script engine instances. Creating a new script engine instance is the only way to guarantee a pristine execution environment. If concurrency is not a requirement, you can reduce costs by reusing the V8 runtime, which would allow you to reuse previously compiled scripts as well. Have a look at the V8Runtime class in the library reference.

Oh, and yes, for JavaScript, ExecuteCommand() is just like Evaluate() except for its treatment of the execution result.

Good luck!

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images