/// <summary>
        /// Constructs an instance of adapter for the Jurassic JS engine
        /// </summary>
        /// <param name="settings">Settings of the Jurassic JS engine</param>
        public JurassicJsEngine(JurassicSettings settings)
        {
            JurassicSettings jurassicSettings = settings ?? new JurassicSettings();

            try
            {
                _jsEngine = new OriginalEngine
                {
                    CompatibilityMode = OriginalCompatibilityMode.Latest,
                    DisableClrCollectionsExposingByValue = !jurassicSettings.EnableHostCollectionsEmbeddingByValue,
#if !NETSTANDARD2_0
                    EnableDebugging = jurassicSettings.EnableDebugging,
#endif
                    EnableExposedClrTypes = true,
                    EnableILAnalysis      = jurassicSettings.EnableIlAnalysis,
                    ForceStrictMode       = jurassicSettings.StrictMode
                };
            }
            catch (Exception e)
            {
                throw JsErrorHelpers.WrapEngineLoadException(e, EngineName, EngineVersion, true);
            }
        }
        /// <summary>
        /// Constructs an instance of adapter for the Jint JS engine
        /// </summary>
        /// <param name="settings">Settings of the Jint JS engine</param>
        public JintJsEngine(JintSettings settings)
        {
            _cancellationTokenSource = new CancellationTokenSource();
            _cancellationConstraint  = new OriginalCancellationConstraint(_cancellationTokenSource.Token);

            JintSettings jintSettings = settings ?? new JintSettings();

            try
            {
                _jsEngine = new OriginalEngine(options => {
                    options
                    .AllowDebuggerStatement(jintSettings.AllowDebuggerStatement)
                    .WithoutConstraint(c => c is OriginalCancellationConstraint)
                    .Constraint(_cancellationConstraint)
                    .DebugMode(jintSettings.EnableDebugging)
                    .LimitMemory(jintSettings.MemoryLimit)
                    .LimitRecursion(jintSettings.MaxRecursionDepth)
                    .LocalTimeZone(jintSettings.LocalTimeZone ?? TimeZoneInfo.Local)
                    .MaxStatements(jintSettings.MaxStatements)
                    .Strict(jintSettings.StrictMode)
                    .TimeoutInterval(jintSettings.TimeoutInterval)
                    ;

                    if (jintSettings.RegexTimeoutInterval.HasValue)
                    {
                        options.RegexTimeoutInterval(jintSettings.RegexTimeoutInterval.Value);
                    }

                    options.AddObjectConverter(new UndefinedConverter());
                });
            }
            catch (Exception e)
            {
                throw JsErrorHelpers.WrapEngineLoadException(e, EngineName, EngineVersion, true);
            }
        }