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

Side by Side Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 994253002: Add an analyzer option to properly check ".call" methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine; 8 library engine;
9 9
10 import "dart:math" as math; 10 import "dart:math" as math;
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 1138
1139 @override 1139 @override
1140 void set analysisOptions(AnalysisOptions options) { 1140 void set analysisOptions(AnalysisOptions options) {
1141 bool needsRecompute = this._options.analyzeFunctionBodiesPredicate != 1141 bool needsRecompute = this._options.analyzeFunctionBodiesPredicate !=
1142 options.analyzeFunctionBodiesPredicate || 1142 options.analyzeFunctionBodiesPredicate ||
1143 this._options.generateImplicitErrors != 1143 this._options.generateImplicitErrors !=
1144 options.generateImplicitErrors || 1144 options.generateImplicitErrors ||
1145 this._options.generateSdkErrors != options.generateSdkErrors || 1145 this._options.generateSdkErrors != options.generateSdkErrors ||
1146 this._options.dart2jsHint != options.dart2jsHint || 1146 this._options.dart2jsHint != options.dart2jsHint ||
1147 (this._options.hint && !options.hint) || 1147 (this._options.hint && !options.hint) ||
1148 this._options.preserveComments != options.preserveComments; 1148 this._options.preserveComments != options.preserveComments ||
1149 this._options.enableStrictCallChecks != options.enableStrictCallChecks;
1149 int cacheSize = options.cacheSize; 1150 int cacheSize = options.cacheSize;
1150 if (this._options.cacheSize != cacheSize) { 1151 if (this._options.cacheSize != cacheSize) {
1151 this._options.cacheSize = cacheSize; 1152 this._options.cacheSize = cacheSize;
1152 //cache.setMaxCacheSize(cacheSize); 1153 //cache.setMaxCacheSize(cacheSize);
1153 _privatePartition.maxCacheSize = cacheSize; 1154 _privatePartition.maxCacheSize = cacheSize;
1154 // 1155 //
1155 // Cap the size of the priority list to being less than the cache size. 1156 // Cap the size of the priority list to being less than the cache size.
1156 // Failure to do so can result in an infinite loop in 1157 // Failure to do so can result in an infinite loop in
1157 // performAnalysisTask() because re-caching one AST structure 1158 // performAnalysisTask() because re-caching one AST structure
1158 // can cause another priority source's AST structure to be flushed. 1159 // can cause another priority source's AST structure to be flushed.
1159 // 1160 //
1160 int maxPriorityOrderSize = cacheSize - _PRIORITY_ORDER_SIZE_DELTA; 1161 int maxPriorityOrderSize = cacheSize - _PRIORITY_ORDER_SIZE_DELTA;
1161 if (_priorityOrder.length > maxPriorityOrderSize) { 1162 if (_priorityOrder.length > maxPriorityOrderSize) {
1162 List<Source> newPriorityOrder = new List<Source>(maxPriorityOrderSize); 1163 List<Source> newPriorityOrder = new List<Source>(maxPriorityOrderSize);
1163 JavaSystem.arraycopy( 1164 JavaSystem.arraycopy(
1164 _priorityOrder, 0, newPriorityOrder, 0, maxPriorityOrderSize); 1165 _priorityOrder, 0, newPriorityOrder, 0, maxPriorityOrderSize);
1165 _priorityOrder = newPriorityOrder; 1166 _priorityOrder = newPriorityOrder;
1166 } 1167 }
1167 } 1168 }
1168 this._options.analyzeFunctionBodiesPredicate = 1169 this._options.analyzeFunctionBodiesPredicate =
1169 options.analyzeFunctionBodiesPredicate; 1170 options.analyzeFunctionBodiesPredicate;
1170 this._options.generateImplicitErrors = options.generateImplicitErrors; 1171 this._options.generateImplicitErrors = options.generateImplicitErrors;
1171 this._options.generateSdkErrors = options.generateSdkErrors; 1172 this._options.generateSdkErrors = options.generateSdkErrors;
1172 this._options.dart2jsHint = options.dart2jsHint; 1173 this._options.dart2jsHint = options.dart2jsHint;
1174 this._options.enableStrictCallChecks = options.enableStrictCallChecks;
1173 this._options.hint = options.hint; 1175 this._options.hint = options.hint;
1174 this._options.incremental = options.incremental; 1176 this._options.incremental = options.incremental;
1175 this._options.incrementalApi = options.incrementalApi; 1177 this._options.incrementalApi = options.incrementalApi;
1176 this._options.incrementalValidation = options.incrementalValidation; 1178 this._options.incrementalValidation = options.incrementalValidation;
1177 this._options.lint = options.lint; 1179 this._options.lint = options.lint;
1178 this._options.preserveComments = options.preserveComments; 1180 this._options.preserveComments = options.preserveComments;
1179 _generateImplicitErrors = options.generateImplicitErrors; 1181 _generateImplicitErrors = options.generateImplicitErrors;
1180 _generateSdkErrors = options.generateSdkErrors; 1182 _generateSdkErrors = options.generateSdkErrors;
1181 if (needsRecompute) { 1183 if (needsRecompute) {
1182 _invalidateAllLocalResolutionInformation(false); 1184 _invalidateAllLocalResolutionInformation(false);
(...skipping 5228 matching lines...) Expand 10 before | Expand all | Expand 10 after
6411 @deprecated // Always true 6413 @deprecated // Always true
6412 bool get enableDeferredLoading; 6414 bool get enableDeferredLoading;
6413 6415
6414 /** 6416 /**
6415 * Return `true` if analysis is to include the new enum support. 6417 * Return `true` if analysis is to include the new enum support.
6416 */ 6418 */
6417 @deprecated // Always true 6419 @deprecated // Always true
6418 bool get enableEnum; 6420 bool get enableEnum;
6419 6421
6420 /** 6422 /**
6423 * Return `true` to strictly follow the specification when generating
6424 * warnings on "call" methods (fixes dartbug.com/21938).
6425 */
6426 bool get enableStrictCallChecks;
6427
6428 /**
6421 * Return `true` if errors, warnings and hints should be generated for sources 6429 * Return `true` if errors, warnings and hints should be generated for sources
6422 * that are implicitly being analyzed. The default value is `true`. 6430 * that are implicitly being analyzed. The default value is `true`.
6423 */ 6431 */
6424 bool get generateImplicitErrors; 6432 bool get generateImplicitErrors;
6425 6433
6426 /** 6434 /**
6427 * Return `true` if errors, warnings and hints should be generated for sources 6435 * Return `true` if errors, warnings and hints should be generated for sources
6428 * in the SDK. The default value is `false`. 6436 * in the SDK. The default value is `false`.
6429 */ 6437 */
6430 bool get generateSdkErrors; 6438 bool get generateSdkErrors;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
6498 */ 6506 */
6499 int cacheSize = DEFAULT_CACHE_SIZE; 6507 int cacheSize = DEFAULT_CACHE_SIZE;
6500 6508
6501 /** 6509 /**
6502 * A flag indicating whether analysis is to generate dart2js related hint 6510 * A flag indicating whether analysis is to generate dart2js related hint
6503 * results. 6511 * results.
6504 */ 6512 */
6505 bool dart2jsHint = true; 6513 bool dart2jsHint = true;
6506 6514
6507 /** 6515 /**
6516 * A flag indicating whether analysis is to strictly follow the specification
6517 * when generating warnings on "call" methods (fixes dartbug.com/21938).
6518 */
6519 bool enableStrictCallChecks = false;
6520
6521 /**
6508 * A flag indicating whether errors, warnings and hints should be generated 6522 * A flag indicating whether errors, warnings and hints should be generated
6509 * for sources that are implicitly being analyzed. 6523 * for sources that are implicitly being analyzed.
6510 */ 6524 */
6511 bool generateImplicitErrors = true; 6525 bool generateImplicitErrors = true;
6512 6526
6513 /** 6527 /**
6514 * A flag indicating whether errors, warnings and hints should be generated 6528 * A flag indicating whether errors, warnings and hints should be generated
6515 * for sources in the SDK. 6529 * for sources in the SDK.
6516 */ 6530 */
6517 bool generateSdkErrors = false; 6531 bool generateSdkErrors = false;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
6556 AnalysisOptionsImpl(); 6570 AnalysisOptionsImpl();
6557 6571
6558 /** 6572 /**
6559 * Initialize a newly created set of analysis options to have the same values 6573 * Initialize a newly created set of analysis options to have the same values
6560 * as those in the given set of analysis [options]. 6574 * as those in the given set of analysis [options].
6561 */ 6575 */
6562 AnalysisOptionsImpl.con1(AnalysisOptions options) { 6576 AnalysisOptionsImpl.con1(AnalysisOptions options) {
6563 analyzeFunctionBodiesPredicate = options.analyzeFunctionBodiesPredicate; 6577 analyzeFunctionBodiesPredicate = options.analyzeFunctionBodiesPredicate;
6564 cacheSize = options.cacheSize; 6578 cacheSize = options.cacheSize;
6565 dart2jsHint = options.dart2jsHint; 6579 dart2jsHint = options.dart2jsHint;
6580 enableStrictCallChecks = options.enableStrictCallChecks;
6566 generateImplicitErrors = options.generateImplicitErrors; 6581 generateImplicitErrors = options.generateImplicitErrors;
6567 generateSdkErrors = options.generateSdkErrors; 6582 generateSdkErrors = options.generateSdkErrors;
6568 hint = options.hint; 6583 hint = options.hint;
6569 incremental = options.incremental; 6584 incremental = options.incremental;
6570 incrementalApi = options.incrementalApi; 6585 incrementalApi = options.incrementalApi;
6571 incrementalValidation = options.incrementalValidation; 6586 incrementalValidation = options.incrementalValidation;
6572 lint = options.lint; 6587 lint = options.lint;
6573 preserveComments = options.preserveComments; 6588 preserveComments = options.preserveComments;
6574 } 6589 }
6575 6590
(...skipping 5628 matching lines...) Expand 10 before | Expand all | Expand 10 after
12204 visitElement(Element element) { 12219 visitElement(Element element) {
12205 if (element.id == _id) { 12220 if (element.id == _id) {
12206 result = element; 12221 result = element;
12207 throw new _ElementByIdFinderException(); 12222 throw new _ElementByIdFinderException();
12208 } 12223 }
12209 super.visitElement(element); 12224 super.visitElement(element);
12210 } 12225 }
12211 } 12226 }
12212 12227
12213 class _ElementByIdFinderException {} 12228 class _ElementByIdFinderException {}
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698