示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JSLintContext" /> class.
        /// </summary>
        /// <param name="javaScriptContextFactory">The JavaScript context factory.</param>
        /// <param name="jsonProvider">The JSON provider.</param>
        internal JSLintContext(Func <IJavaScriptContext> javaScriptContextFactory, IJsonProvider jsonProvider)
        {
            this.context      = javaScriptContextFactory();
            this.jsonProvider = jsonProvider;

            this.LoadJSLint();
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JSLintContext" /> class.
        /// </summary>
        /// <param name="javaScriptContextFactory">The JavaScript context factory.</param>
        /// <param name="jsonProvider">The JSON provider.</param>
        internal JSLintContext(Func<IJavaScriptContext> javaScriptContextFactory, IJsonProvider jsonProvider)
        {
            this.context = javaScriptContextFactory();
            this.jsonProvider = jsonProvider;

            this.LoadJSLint();
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JSLintContext" /> class.
        /// </summary>
        /// <param name="abstractionFactory">The abstraction factory.</param>
        /// <param name="jsonProvider">The JSON provider.</param>
        /// <param name="fileSystemWrapper">The file system wrapper.</param>
        internal JSLintContext(IAbstractionFactory abstractionFactory, IJsonProvider jsonProvider, IFileSystemWrapper fileSystemWrapper)
        {
            this.context = abstractionFactory.CreateJavaScriptContext();
            this.jsonProvider = jsonProvider;
            this.fileSystemWrapper = fileSystemWrapper;

            this.LoadJSLint();
        }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JSLintContext" /> class.
        /// </summary>
        /// <param name="abstractionFactory">The abstraction factory.</param>
        /// <param name="jsonProvider">The JSON provider.</param>
        /// <param name="fileSystemWrapper">The file system wrapper.</param>
        internal JSLintContext(IAbstractionFactory abstractionFactory, IJsonProvider jsonProvider, IFileSystemWrapper fileSystemWrapper)
        {
            this.context           = abstractionFactory.CreateJavaScriptContext();
            this.jsonProvider      = jsonProvider;
            this.fileSystemWrapper = fileSystemWrapper;

            this.LoadJSLint();
        }
		public TypeScriptContext(IJavaScriptContext context, IScriptLoader scriptLoader, ILogger logger)
		{
			this.context = context;
			this.scriptLoader = scriptLoader;
			host = new LanguageServiceShimHost(logger);
			host.AddDefaultLibScript(new FileName(scriptLoader.LibScriptFileName), scriptLoader.GetLibScript());
			
			if (context != null) {
				context.SetParameter("host", host);
				context.Run(scriptLoader.GetTypeScriptServicesScript());
			}
		}
示例#6
0
        public TypeScriptContext(IJavaScriptContext context, IScriptLoader scriptLoader, ILogger logger)
        {
            this.context      = context;
            this.scriptLoader = scriptLoader;
            host = new LanguageServiceShimHost(logger);
            host.AddDefaultLibScript(new FileName(scriptLoader.LibScriptFileName), scriptLoader.GetLibScript());

            if (context != null)
            {
                context.SetParameter("host", host);
                context.Run(scriptLoader.GetTypeScriptServicesScript());
            }
        }