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

Side by Side Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 1605923005: Improve failure mode when there is no SDK (issue 25528) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library analyzer.src.task.dart; 5 library analyzer.src.task.dart;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/visitor.dart'; 10 import 'package:analyzer/dart/ast/visitor.dart';
(...skipping 3533 matching lines...) Expand 10 before | Expand all | Expand 10 after
3544 } 3544 }
3545 } 3545 }
3546 } 3546 }
3547 } 3547 }
3548 // 3548 //
3549 // Always include "dart:core" source. 3549 // Always include "dart:core" source.
3550 // 3550 //
3551 HashSet<Source> importedSourceSet = 3551 HashSet<Source> importedSourceSet =
3552 new HashSet.from(explicitlyImportedSourceSet); 3552 new HashSet.from(explicitlyImportedSourceSet);
3553 Source coreLibrarySource = context.sourceFactory.forUri(DartSdk.DART_CORE); 3553 Source coreLibrarySource = context.sourceFactory.forUri(DartSdk.DART_CORE);
3554 if (coreLibrarySource == null) {
3555 String message;
3556 DartSdk sdk = context.sourceFactory.dartSdk;
3557 if (sdk == null) {
3558 message = 'Could not resolve "dart:core": SDK not defined';
3559 } else {
3560 message = 'Could not resolve "dart:core": SDK incorrectly configured';
3561 }
3562 throw new AnalysisException(message);
3563 }
3554 importedSourceSet.add(coreLibrarySource); 3564 importedSourceSet.add(coreLibrarySource);
3555 // 3565 //
3556 // Compute kind. 3566 // Compute kind.
3557 // 3567 //
3558 SourceKind sourceKind = SourceKind.LIBRARY; 3568 SourceKind sourceKind = SourceKind.LIBRARY;
3559 if (modificationTime == -1) { 3569 if (modificationTime == -1) {
3560 sourceKind = SourceKind.UNKNOWN; 3570 sourceKind = SourceKind.UNKNOWN;
3561 } else if (hasPartOfDirective && !hasNonPartOfDirective) { 3571 } else if (hasPartOfDirective && !hasNonPartOfDirective) {
3562 sourceKind = SourceKind.PART; 3572 sourceKind = SourceKind.PART;
3563 } 3573 }
(...skipping 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after
5446 5456
5447 @override 5457 @override
5448 bool moveNext() { 5458 bool moveNext() {
5449 if (_newSources.isEmpty) { 5459 if (_newSources.isEmpty) {
5450 return false; 5460 return false;
5451 } 5461 }
5452 currentTarget = _newSources.removeLast(); 5462 currentTarget = _newSources.removeLast();
5453 return true; 5463 return true;
5454 } 5464 }
5455 } 5465 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698