| Index: lib/compiler/implementation/elements/elements.dart
|
| ===================================================================
|
| --- lib/compiler/implementation/elements/elements.dart (revision 12903)
|
| +++ lib/compiler/implementation/elements/elements.dart (working copy)
|
| @@ -945,6 +945,9 @@
|
| final int requiredParameterCount;
|
| final int optionalParameterCount;
|
| final bool optionalParametersAreNamed;
|
| +
|
| + List<Element> _orderedOptionalParameters;
|
| +
|
| FunctionSignature(this.requiredParameters,
|
| this.optionalParameters,
|
| this.requiredParameterCount,
|
| @@ -968,11 +971,28 @@
|
| }
|
| }
|
|
|
| + List<Element> get orderedOptionalParameters {
|
| + if (_orderedOptionalParameters != null) return _orderedOptionalParameters;
|
| + List<Element> list = new List<Element>.from(optionalParameters);
|
| + if (optionalParametersAreNamed) {
|
| + list.sort((Element a, Element b) {
|
| + return a.name.slowToString().compareTo(b.name.slowToString());
|
| + });
|
| + }
|
| + _orderedOptionalParameters = list;
|
| + return list;
|
| + }
|
| +
|
| void forEachParameter(void function(Element parameter)) {
|
| forEachRequiredParameter(function);
|
| forEachOptionalParameter(function);
|
| }
|
|
|
| + void orderedForEachParameter(void function(Element parameter)) {
|
| + forEachRequiredParameter(function);
|
| + orderedOptionalParameters.forEach(function);
|
| + }
|
| +
|
| int get parameterCount => requiredParameterCount + optionalParameterCount;
|
| }
|
|
|
|
|