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

Unified Diff: lib/devc.dart

Issue 1143683002: cleanup: simplify creation of AnalysisContext (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 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 | « bin/edit_files.dart ('k') | lib/src/analysis_context.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/devc.dart
diff --git a/lib/devc.dart b/lib/devc.dart
index a187e71bd390c32d2c930322b0949a974a257c6b..2a9e186931930a484a3fb497ab566e59b7b7ac2c 100644
--- a/lib/devc.dart
+++ b/lib/devc.dart
@@ -19,9 +19,9 @@ import 'package:shelf/shelf.dart' as shelf;
import 'package:shelf/shelf_io.dart' as shelf;
import 'package:shelf_static/shelf_static.dart' as shelf_static;
+
+import 'src/analysis_context.dart';
import 'src/checker/checker.dart';
-import 'src/checker/dart_sdk.dart' show mockSdkSources;
-import 'src/checker/resolver.dart';
import 'src/checker/rules.dart';
import 'src/codegen/code_generator.dart' show CodeGenerator;
import 'src/codegen/dart_codegen.dart';
@@ -65,13 +65,9 @@ class Compiler implements AbstractCompiler {
bool _failure = false;
factory Compiler(CompilerOptions options,
- {TypeResolver resolver, CheckerReporter reporter}) {
- if (resolver == null) {
- resolver = options.useMockSdk
- ? new TypeResolver.fromMock(mockSdkSources, options)
- : new TypeResolver.fromDir(options.dartSdkPath, options);
- }
- var context = resolver.context;
+ {AnalysisContext context, CheckerReporter reporter}) {
+
+ if (context == null) context = createAnalysisContext(options);
if (reporter == null) {
reporter = options.dumpInfo
« no previous file with comments | « bin/edit_files.dart ('k') | lib/src/analysis_context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698