/// <summary>
        /// Translates a code of assets written on TypeScript to JS-code
        /// </summary>
        /// <param name="assets">Set of assets with code written on TypeScript</param>
        /// <returns>Set of assets with translated code</returns>
        public IList<IAsset> Translate(IList<IAsset> assets)
        {
            if (assets == null)
            {
                throw new ArgumentException(CoreStrings.Common_ValueIsEmpty, "assets");
            }

            if (assets.Count == 0)
            {
                return assets;
            }

            var assetsToProcessing = assets.Where(a => a.AssetTypeCode == Constants.AssetTypeCode.TypeScript).ToList();
            if (assetsToProcessing.Count == 0)
            {
                return assets;
            }

            lock (_translationSynchronizer)
            {
                CompilationOptions options = CreateCompilationOptions();
                var typeScriptCompiler = new TypeScriptCompiler(_createJsEngineInstance, options);

                ClearTsScriptCache();

                try
                {
                    foreach (var asset in assetsToProcessing)
                    {
                        InnerTranslate(asset, typeScriptCompiler);
                    }
                }
                finally
                {
                    typeScriptCompiler.Dispose();
                    ClearTsScriptCache();
                }
            }

            return assets;
        }
        /// <summary>
        /// Translates a code of asset written on TypeScript to JS-code
        /// </summary>
        /// <param name="asset">Asset with code written on TypeScript</param>
        /// <returns>Asset with translated code</returns>
        public IAsset Translate(IAsset asset)
        {
            if (asset == null)
            {
                throw new ArgumentException(CoreStrings.Common_ValueIsEmpty, "asset");
            }

            lock (_translationSynchronizer)
            {
                CompilationOptions options = CreateCompilationOptions();
                var typeScriptCompiler = new TypeScriptCompiler(_createJsEngineInstance, options);

                ClearTsScriptCache();

                try
                {
                    InnerTranslate(asset, typeScriptCompiler);
                }
                finally
                {
                    typeScriptCompiler.Dispose();
                    ClearTsScriptCache();
                }
            }

            return asset;
        }