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

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

Issue 1183723002: Explicitly compute library errors in tests. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | 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 import 'dart:math' as math; 8 import 'dart:math' as math;
9 9
10 import 'package:analyzer/src/context/cache.dart'; 10 import 'package:analyzer/src/context/cache.dart';
(...skipping 3331 matching lines...) Expand 10 before | Expand all | Expand 10 after
3342 // 3342 //
3343 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT); 3343 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
3344 CompilationUnit unit = getRequiredInput(UNIT_INPUT); 3344 CompilationUnit unit = getRequiredInput(UNIT_INPUT);
3345 CompilationUnitElement unitElement = unit.element; 3345 CompilationUnitElement unitElement = unit.element;
3346 LibraryElement libraryElement = unitElement.library; 3346 LibraryElement libraryElement = unitElement.library;
3347 // 3347 //
3348 // Validate the directives. 3348 // Validate the directives.
3349 // 3349 //
3350 validateDirectives(unit); 3350 validateDirectives(unit);
3351 // 3351 //
3352 // Use the ConstantVerifier to compute errors.
3353 //
3354 ConstantVerifier constantVerifier = new ConstantVerifier(
3355 errorReporter, libraryElement, typeProvider, context.declaredVariables);
3356 unit.accept(constantVerifier);
3357 //
3352 // Use the ErrorVerifier to compute errors. 3358 // Use the ErrorVerifier to compute errors.
3353 // 3359 //
3354 ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter, 3360 ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter,
3355 libraryElement, typeProvider, new InheritanceManager(libraryElement)); 3361 libraryElement, typeProvider, new InheritanceManager(libraryElement));
3356 unit.accept(errorVerifier); 3362 unit.accept(errorVerifier);
3357 // 3363 //
3358 // Use the ConstantVerifier to compute errors.
3359 //
3360 ConstantVerifier constantVerifier = new ConstantVerifier(
3361 errorReporter, libraryElement, typeProvider, context.declaredVariables);
3362 unit.accept(constantVerifier);
3363 //
3364 // Record outputs. 3364 // Record outputs.
3365 // 3365 //
3366 outputs[VERIFY_ERRORS] = removeDuplicateErrors(errorListener.errors); 3366 outputs[VERIFY_ERRORS] = removeDuplicateErrors(errorListener.errors);
3367 } 3367 }
3368 3368
3369 /** 3369 /**
3370 * Check each directive in the given [unit] to see if the referenced source 3370 * Check each directive in the given [unit] to see if the referenced source
3371 * exists and report an error if it does not. 3371 * exists and report an error if it does not.
3372 */ 3372 */
3373 void validateDirectives(CompilationUnit unit) { 3373 void validateDirectives(CompilationUnit unit) {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
3526 @override 3526 @override
3527 bool moveNext() { 3527 bool moveNext() {
3528 if (_newSources.isEmpty) { 3528 if (_newSources.isEmpty) {
3529 return false; 3529 return false;
3530 } 3530 }
3531 currentTarget = _newSources.first; 3531 currentTarget = _newSources.first;
3532 _newSources.remove(currentTarget); 3532 _newSources.remove(currentTarget);
3533 return true; 3533 return true;
3534 } 3534 }
3535 } 3535 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698