Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Unified Diff: lib/src/analyzer/context.dart

Issue 2183603003: Working compiler in browser. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Git merged master Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/src/compiler/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/analyzer/context.dart
diff --git a/lib/src/analyzer/context.dart b/lib/src/analyzer/context.dart
index d418c4209e1ae28a406c3870c7460c8a44af29b6..714a874e724ade63377e8a205fe48808aa8b90b5 100644
--- a/lib/src/analyzer/context.dart
+++ b/lib/src/analyzer/context.dart
@@ -3,15 +3,17 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'package:analyzer/file_system/file_system.dart' show ResourceUriResolver;
+import 'package:args/args.dart' show ArgParser, ArgResults;
+import 'package:analyzer/file_system/file_system.dart'
+ show ResourceProvider, ResourceUriResolver;
import 'package:analyzer/file_system/physical_file_system.dart'
show PhysicalResourceProvider;
-import 'package:args/args.dart' show ArgParser, ArgResults;
import 'package:analyzer/src/context/context.dart' show AnalysisContextImpl;
import 'package:analyzer/src/generated/engine.dart'
show AnalysisContext, AnalysisEngine, AnalysisOptionsImpl;
import 'package:analyzer/src/generated/java_io.dart' show JavaFile;
import 'package:analyzer/src/generated/sdk_io.dart' show DirectoryBasedDartSdk;
+import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/source_io.dart'
show
CustomUriResolver,
@@ -107,7 +109,9 @@ class AnalyzerOptions {
/// Creates an [AnalysisContext] with dev_compiler type rules and inference,
/// using [createSourceFactory] to set up its [SourceFactory].
AnalysisContext createAnalysisContextWithSources(AnalyzerOptions options,
- {DartUriResolver sdkResolver, List<UriResolver> fileResolvers}) {
+ {DartUriResolver sdkResolver,
+ List<UriResolver> fileResolvers,
+ ResourceProvider resourceProvider}) {
AnalysisEngine.instance.processRequiredPlugins();
sdkResolver ??=
@@ -122,7 +126,8 @@ AnalysisContext createAnalysisContextWithSources(AnalyzerOptions options,
var srcFactory = _createSourceFactory(options,
sdkResolver: sdkResolver,
fileResolvers: fileResolvers,
- summaryData: summaryData);
+ summaryData: summaryData,
+ resourceProvider: resourceProvider);
var context = createAnalysisContext();
context.sourceFactory = srcFactory;
@@ -153,7 +158,8 @@ AnalysisContextImpl createAnalysisContext() {
SourceFactory _createSourceFactory(AnalyzerOptions options,
{DartUriResolver sdkResolver,
List<UriResolver> fileResolvers,
- SummaryDataStore summaryData}) {
+ SummaryDataStore summaryData,
+ ResourceProvider resourceProvider}) {
var resolvers = <UriResolver>[];
if (options.customUrlMappings.isNotEmpty) {
resolvers.add(new CustomUriResolver(options.customUrlMappings));
@@ -165,7 +171,7 @@ SourceFactory _createSourceFactory(AnalyzerOptions options,
if (fileResolvers == null) fileResolvers = createFileResolvers(options);
resolvers.addAll(fileResolvers);
- return new SourceFactory(resolvers);
+ return new SourceFactory(resolvers, null, resourceProvider);
}
List<UriResolver> createFileResolvers(AnalyzerOptions options) {
« no previous file with comments | « no previous file | lib/src/compiler/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698