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

Side by Side Diff: pkg/analyzer/test/generated/resolver_test.dart

Issue 967703002: Avoid unnecessary parsing/resolution when running command line analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address code review comments Created 5 years, 9 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 | Annotate | Revision Log
« 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 engine.resolver_test; 5 library engine.resolver_test;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/src/generated/ast.dart'; 9 import 'package:analyzer/src/generated/ast.dart';
10 import 'package:analyzer/src/generated/element.dart'; 10 import 'package:analyzer/src/generated/element.dart';
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 /** 375 /**
376 * Instances of the class `AnalysisContextForTests` implement an analysis contex t that has a 376 * Instances of the class `AnalysisContextForTests` implement an analysis contex t that has a
377 * fake SDK that is much smaller and faster for testing purposes. 377 * fake SDK that is much smaller and faster for testing purposes.
378 */ 378 */
379 class AnalysisContextForTests extends AnalysisContextImpl { 379 class AnalysisContextForTests extends AnalysisContextImpl {
380 @override 380 @override
381 void set analysisOptions(AnalysisOptions options) { 381 void set analysisOptions(AnalysisOptions options) {
382 AnalysisOptions currentOptions = analysisOptions; 382 AnalysisOptions currentOptions = analysisOptions;
383 bool needsRecompute = 383 bool needsRecompute =
384 currentOptions.analyzeFunctionBodies != options.analyzeFunctionBodies || 384 currentOptions.analyzeFunctionBodiesPredicate !=
385 options.analyzeFunctionBodiesPredicate ||
385 currentOptions.generateSdkErrors != options.generateSdkErrors || 386 currentOptions.generateSdkErrors != options.generateSdkErrors ||
386 currentOptions.dart2jsHint != options.dart2jsHint || 387 currentOptions.dart2jsHint != options.dart2jsHint ||
387 (currentOptions.hint && !options.hint) || 388 (currentOptions.hint && !options.hint) ||
388 currentOptions.preserveComments != options.preserveComments; 389 currentOptions.preserveComments != options.preserveComments;
389 if (needsRecompute) { 390 if (needsRecompute) {
390 fail( 391 fail(
391 "Cannot set options that cause the sources to be reanalyzed in a test context"); 392 "Cannot set options that cause the sources to be reanalyzed in a test context");
392 } 393 }
393 super.analysisOptions = options; 394 super.analysisOptions = options;
394 } 395 }
(...skipping 13392 matching lines...) Expand 10 before | Expand all | Expand 10 after
13787 // check propagated type 13788 // check propagated type
13788 FunctionType propagatedType = node.propagatedType as FunctionType; 13789 FunctionType propagatedType = node.propagatedType as FunctionType;
13789 expect(propagatedType.returnType, test.typeProvider.stringType); 13790 expect(propagatedType.returnType, test.typeProvider.stringType);
13790 } on AnalysisException catch (e, stackTrace) { 13791 } on AnalysisException catch (e, stackTrace) {
13791 thrownException[0] = new CaughtException(e, stackTrace); 13792 thrownException[0] = new CaughtException(e, stackTrace);
13792 } 13793 }
13793 } 13794 }
13794 return null; 13795 return null;
13795 } 13796 }
13796 } 13797 }
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