Taritsyn / JavaScriptEngineSwitcher

JavaScript Engine Switcher determines unified interface for access to the basic features of popular JavaScript engines. This library allows you to quickly and easily switch to using of another JavaScript engine.
Apache License 2.0
440 stars 49 forks source link

Expose Compile in JsEngineBase for better support of V8 #10

Closed huan086 closed 9 years ago

huan086 commented 9 years ago

V8 supports compilation and reusing the compiled scripts. Supporting a Compile step (returns an object), and having Evaluate (that takes an object) on the compile script would allow consumers to improve performance.

For engines that do not support compilation, Compile could return an object that encapsulates the string to be evaluated. Evaluate would then evaluate the encapsulated string as usual.

Taritsyn commented 9 years ago

In the JavaScriptEngineSwitcher there will be no specific methods.

If you need this functionality, then use the Microsoft ClearScript.V8 directly.

Taritsyn commented 5 years ago

Hello, Jeow!

This feature was implemented in version 3.0.0 and supported by the following modules: ChakraCore, Jint, Jurassic, MSIE and V8. You can read about how this feature works in the “How to upgrade applications to version 3.X > Script pre-compilation” subsection of documentation.

huan086 commented 5 years ago

Thanks so much!