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

Allow reinitialization of JSEngineSwitcher #53

Closed Dadstart closed 6 years ago

Dadstart commented 6 years ago

In response to a configuration change on my service I sometimes need to switch engines. Currently there's no way to reinitialize the JSEngineSwitcher so my only solution is to unload my app domain and let IIS create a new app domain (where my code uses the new default engine).

JSEngineSwitcher needs a way to be reinitialized. Just changing JsEngineSwitcher.Instance.DefaultEngineName doesn't actually change the engine being used.

Taritsyn commented 6 years ago

Hello, Andrew!

Try to using a CreateEngine method with a variable instead of constant.

Taritsyn commented 6 years ago

Just changing JsEngineSwitcher.Instance.DefaultEngineName doesn't actually change the engine being used.

Changing value of the DefaultEngineName property will affect only to newly created JS engine.