OLD | NEW |
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 /// Mixins that implement convenience methods on [Element] subclasses. | 5 /// Mixins that implement convenience methods on [Element] subclasses. |
6 | 6 |
7 library elements.common; | 7 library elements.common; |
8 | 8 |
9 import '../common/names.dart' show Identifiers, Names, Uris; | 9 import '../common/names.dart' show Identifiers, Names, Uris; |
10 import '../common_elements.dart' show CommonElements; | 10 import '../common_elements.dart' show CommonElements; |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 void forEachConstructorBody(void f(ConstructorBodyElement member)) { | 496 void forEachConstructorBody(void f(ConstructorBodyElement member)) { |
497 constructorBodies.forEach(f); | 497 constructorBodies.forEach(f); |
498 } | 498 } |
499 } | 499 } |
500 | 500 |
501 abstract class FunctionSignatureCommon implements FunctionSignature { | 501 abstract class FunctionSignatureCommon implements FunctionSignature { |
502 ParameterStructure _parameterStructure; | 502 ParameterStructure _parameterStructure; |
503 | 503 |
504 ResolutionDartType get returnType => type.returnType; | 504 ResolutionDartType get returnType => type.returnType; |
505 | 505 |
506 void forEachRequiredParameter(void function(Element parameter)) { | 506 void forEachRequiredParameter(void function(FormalElement parameter)) { |
507 requiredParameters.forEach(function); | 507 requiredParameters.forEach(function); |
508 } | 508 } |
509 | 509 |
510 void forEachOptionalParameter(void function(Element parameter)) { | 510 void forEachOptionalParameter(void function(FormalElement parameter)) { |
511 optionalParameters.forEach(function); | 511 optionalParameters.forEach(function); |
512 } | 512 } |
513 | 513 |
514 void forEachParameter(void function(Element parameter)) { | 514 void forEachParameter(void function(FormalElement parameter)) { |
515 forEachRequiredParameter(function); | 515 forEachRequiredParameter(function); |
516 forEachOptionalParameter(function); | 516 forEachOptionalParameter(function); |
517 } | 517 } |
518 | 518 |
519 void orderedForEachParameter(void function(Element parameter)) { | 519 void orderedForEachParameter(void function(FormalElement parameter)) { |
520 forEachRequiredParameter(function); | 520 forEachRequiredParameter(function); |
521 orderedOptionalParameters.forEach(function); | 521 orderedOptionalParameters.forEach(function); |
522 } | 522 } |
523 | 523 |
524 int get parameterCount => requiredParameterCount + optionalParameterCount; | 524 int get parameterCount => requiredParameterCount + optionalParameterCount; |
525 | 525 |
526 /** | 526 /** |
527 * Check whether a function with this signature can be used instead of a | 527 * Check whether a function with this signature can be used instead of a |
528 * function with signature [signature] without causing a `noSuchMethod` | 528 * function with signature [signature] without causing a `noSuchMethod` |
529 * exception/call. | 529 * exception/call. |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 @override | 669 @override |
670 bool get isBoolFromEnvironmentConstructor { | 670 bool get isBoolFromEnvironmentConstructor { |
671 return fromEnvironmentState == _FromEnvironmentState.BOOL; | 671 return fromEnvironmentState == _FromEnvironmentState.BOOL; |
672 } | 672 } |
673 | 673 |
674 @override | 674 @override |
675 bool get isStringFromEnvironmentConstructor { | 675 bool get isStringFromEnvironmentConstructor { |
676 return fromEnvironmentState == _FromEnvironmentState.STRING; | 676 return fromEnvironmentState == _FromEnvironmentState.STRING; |
677 } | 677 } |
678 } | 678 } |
OLD | NEW |