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

Side by Side Diff: pkg/analyzer/lib/src/dart/analysis/driver.dart

Issue 2639743002: Report StateError if the DartSDK for an AnalysisDriver does not have summary. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'dart:typed_data'; 7 import 'dart:typed_data';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/element/element.dart' show CompilationUnitElement; 10 import 'package:analyzer/dart/element/element.dart' show CompilationUnitElement;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 */ 71 */
72 class AnalysisDriver { 72 class AnalysisDriver {
73 /** 73 /**
74 * The version of data format, should be incremented on every format change. 74 * The version of data format, should be incremented on every format change.
75 */ 75 */
76 static const int DATA_VERSION = 11; 76 static const int DATA_VERSION = 11;
77 77
78 /** 78 /**
79 * The name of the driver, e.g. the name of the folder. 79 * The name of the driver, e.g. the name of the folder.
80 */ 80 */
81 String name; 81 final String name;
82 82
83 /** 83 /**
84 * The scheduler that schedules analysis work in this, and possibly other 84 * The scheduler that schedules analysis work in this, and possibly other
85 * analysis drivers. 85 * analysis drivers.
86 */ 86 */
87 final AnalysisDriverScheduler _scheduler; 87 final AnalysisDriverScheduler _scheduler;
88 88
89 /** 89 /**
90 * The logger to write performed operations and performance to. 90 * The logger to write performed operations and performance to.
91 */ 91 */
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 * 232 *
233 * The given [SourceFactory] is cloned to ensure that it does not contain a 233 * The given [SourceFactory] is cloned to ensure that it does not contain a
234 * reference to a [AnalysisContext] in which it could have been used. 234 * reference to a [AnalysisContext] in which it could have been used.
235 */ 235 */
236 AnalysisDriver( 236 AnalysisDriver(
237 this._scheduler, 237 this._scheduler,
238 this._logger, 238 this._logger,
239 this._resourceProvider, 239 this._resourceProvider,
240 this._byteStore, 240 this._byteStore,
241 this._contentOverlay, 241 this._contentOverlay,
242 this.name,
242 SourceFactory sourceFactory, 243 SourceFactory sourceFactory,
243 this._analysisOptions) 244 this._analysisOptions)
244 : _sourceFactory = sourceFactory.clone() { 245 : _sourceFactory = sourceFactory.clone() {
245 _testView = new AnalysisDriverTestView(this); 246 _testView = new AnalysisDriverTestView(this);
246 _fillSalt(); 247 _fillSalt();
247 _sdkBundle = sourceFactory.dartSdk.getLinkedBundle(); 248 _sdkBundle = sourceFactory.dartSdk.getLinkedBundle();
249 if (_sdkBundle == null) {
250 Type sdkType = sourceFactory.dartSdk.runtimeType;
251 String message = 'DartSdk ($sdkType) for $name does not have summary.';
252 AnalysisEngine.instance.logger.logError(message);
253 throw new StateError(message);
254 }
248 _fsState = new FileSystemState( 255 _fsState = new FileSystemState(
249 _logger, 256 _logger,
250 _byteStore, 257 _byteStore,
251 _contentOverlay, 258 _contentOverlay,
252 _resourceProvider, 259 _resourceProvider,
253 sourceFactory, 260 sourceFactory,
254 _analysisOptions, 261 _analysisOptions,
255 _salt, 262 _salt,
256 _sdkBundle.apiSignature); 263 _sdkBundle.apiSignature);
257 _scheduler._add(this); 264 _scheduler._add(this);
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after
1680 libraryDeclarations.add(new TopLevelDeclarationInSource( 1687 libraryDeclarations.add(new TopLevelDeclarationInSource(
1681 file.source, declaration, isExported)); 1688 file.source, declaration, isExported));
1682 } 1689 }
1683 } 1690 }
1684 } 1691 }
1685 1692
1686 // We're not done yet. 1693 // We're not done yet.
1687 return false; 1694 return false;
1688 } 1695 }
1689 } 1696 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/services/search/search_engine2_test.dart ('k') | pkg/analyzer/test/generated/resolver_test_case.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698