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

Side by Side Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1165283006: Build full LIBRARY_ELEMENT for every library source in the import/export closure, when resolve a un… (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 | « pkg/analyzer/lib/src/task/dart.dart ('k') | 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 test.src.task.dart_test; 5 library test.src.task.dart_test;
6 6
7 import 'package:analyzer/src/context/cache.dart'; 7 import 'package:analyzer/src/context/cache.dart';
8 import 'package:analyzer/src/generated/ast.dart'; 8 import 'package:analyzer/src/generated/ast.dart';
9 import 'package:analyzer/src/generated/constant.dart'; 9 import 'package:analyzer/src/generated/constant.dart';
10 import 'package:analyzer/src/generated/element.dart'; 10 import 'package:analyzer/src/generated/element.dart';
(...skipping 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after
2498 /** 2498 /**
2499 * Verify that the mutated states of the given [variable] correspond to the 2499 * Verify that the mutated states of the given [variable] correspond to the
2500 * [mutatedInClosure] and [mutatedInScope] matchers. 2500 * [mutatedInClosure] and [mutatedInScope] matchers.
2501 */ 2501 */
2502 void expectMutated(VariableElement variable, Matcher mutatedInClosure, 2502 void expectMutated(VariableElement variable, Matcher mutatedInClosure,
2503 Matcher mutatedInScope) { 2503 Matcher mutatedInScope) {
2504 expect(variable.isPotentiallyMutatedInClosure, mutatedInClosure); 2504 expect(variable.isPotentiallyMutatedInClosure, mutatedInClosure);
2505 expect(variable.isPotentiallyMutatedInScope, mutatedInScope); 2505 expect(variable.isPotentiallyMutatedInScope, mutatedInScope);
2506 } 2506 }
2507 2507
2508 test_perform_buildClosureLibraryElements() {
2509 Source source = newSource('/test.dart', '''
2510 main() {
2511 }
2512 ''');
2513 LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
2514 _computeResult(target, RESOLVED_UNIT5);
2515 expect(task, new isInstanceOf<ResolveVariableReferencesTask>());
2516 // dart:core LIBRARY_ELEMENT is built
2517 expect(analysisCache.getState(
2518 context.sourceFactory.resolveUri(null, 'dart:core'),
2519 LIBRARY_ELEMENT), CacheState.VALID);
2520 }
2521
2508 test_perform_local() { 2522 test_perform_local() {
2509 Source source = newSource('/test.dart', ''' 2523 Source source = newSource('/test.dart', '''
2510 main() { 2524 main() {
2511 var v1 = 1; 2525 var v1 = 1;
2512 var v2 = 1; 2526 var v2 = 1;
2513 var v3 = 1; 2527 var v3 = 1;
2514 var v4 = 1; 2528 var v4 = 1;
2515 v2 = 2; 2529 v2 = 2;
2516 v4 = 2; 2530 v4 = 2;
2517 localFunction() { 2531 localFunction() {
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2686 /** 2700 /**
2687 * Fill [errorListener] with [result] errors in the current [task]. 2701 * Fill [errorListener] with [result] errors in the current [task].
2688 */ 2702 */
2689 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { 2703 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) {
2690 List<AnalysisError> errors = task.outputs[result]; 2704 List<AnalysisError> errors = task.outputs[result];
2691 expect(errors, isNotNull, reason: result.name); 2705 expect(errors, isNotNull, reason: result.name);
2692 errorListener = new GatheringErrorListener(); 2706 errorListener = new GatheringErrorListener();
2693 errorListener.addAll(errors); 2707 errorListener.addAll(errors);
2694 } 2708 }
2695 } 2709 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698