/// <summary>
        /// Constructs a instance of EcmaScript2015-translator
        /// </summary>
        /// <param name="createJsEngineInstance">Delegate that creates an instance of JavaScript engine</param>
        /// <param name="babelJsConfig">Configuration settings of EcmaScript2015-translator</param>
        public BabelJsTranslator(Func<IJsEngine> createJsEngineInstance, BabelJsSettings babelJsConfig)
        {           
            if (createJsEngineInstance == null)
            {
                _babelJsConfig = babelJsConfig;

                var jsEngineName = _babelJsConfig.JsEngine.Name;
                if (string.IsNullOrWhiteSpace(jsEngineName))
                {
                    throw new ConfigurationErrorsException(
                        string.Format(CoreStrings.Configuration_JsEngineNotSpecified,
                            "babelJs",
                            @"
  * JavaScriptEngineSwitcher.Msie
  * JavaScriptEngineSwitcher.V8",
                            "MsieJsEngine")
                    );
                }

                createJsEngineInstance = (() =>
                    JsEngineSwitcher.Current.CreateJsEngineInstance(jsEngineName));
            }
            _createJsEngineInstance = createJsEngineInstance;
        }
 private BabelJsCompilationOptions CreateCompilationOptions(BabelJsSettings settings)
 {
     return new BabelJsCompilationOptions()
     {
         Comments = settings.Comments,
         Compact = settings.Compact,
         HighlightCode = settings.HighlightCode,
         SourceMaps = settings.SourceMaps
     };
 }