forked from Taritsyn/JavaScriptEngineSwitcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJsEngineSwitcherInitializer.cs
More file actions
43 lines (40 loc) · 922 Bytes
/
JsEngineSwitcherInitializer.cs
File metadata and controls
43 lines (40 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using JavaScriptEngineSwitcher.ChakraCore;
using JavaScriptEngineSwitcher.Core;
using JavaScriptEngineSwitcher.Core.Utilities;
using JavaScriptEngineSwitcher.Jint;
using JavaScriptEngineSwitcher.Msie;
using JavaScriptEngineSwitcher.Vroom;
#if !NETCOREAPP1_0
using JavaScriptEngineSwitcher.Jurassic;
#endif
#if !NETCOREAPP
using JavaScriptEngineSwitcher.V8;
#endif
namespace JavaScriptEngineSwitcher.Tests
{
internal static class JsEngineSwitcherInitializer
{
private static InterlockedStatedFlag _initializedFlag = new InterlockedStatedFlag();
public static void Initialize()
{
if (_initializedFlag.Set())
{
JsEngineSwitcher.Current.EngineFactories
.AddChakraCore()
.AddJint()
.AddMsie(new MsieSettings
{
EngineMode = JsEngineMode.ChakraIeJsRt
})
.AddVroom()
#if !NETCOREAPP1_0
.AddJurassic()
#endif
#if !NETCOREAPP
.AddV8()
#endif
;
}
}
}
}