Initialize() public static method

Initialize a assembly resolver
public static Initialize ( ) : void
return void
Exemplo n.º 1
0
        /// <summary>
        /// Initializes a JS engine
        /// </summary>
        private static void Initialize()
        {
            if (_initialized)
            {
                return;
            }

            lock (_initializationSynchronizer)
            {
                if (_initialized)
                {
                    return;
                }

                if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
                {
                    try
                    {
                        AssemblyResolver.Initialize();
                    }
                    catch (InvalidOperationException e)
                    {
                        throw CoreErrorHelpers.WrapEngineLoadException(e, EngineName, EngineVersion);
                    }
                }

                _initialized = true;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Static constructor
 /// </summary>
 static ChakraCoreJsEngine()
 {
     if (Utils.IsWindows())
     {
         AssemblyResolver.Initialize();
     }
 }