OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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('elements'); | 5 #library('elements'); |
6 | 6 |
7 #import('dart:uri'); | 7 #import('dart:uri'); |
8 | 8 |
9 #import('../tree/tree.dart'); | 9 #import('../tree/tree.dart'); |
10 #import('../scanner/scannerlib.dart'); | 10 #import('../scanner/scannerlib.dart'); |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 | 840 |
841 AbstractFieldElement cloneTo(Element enclosing, DiagnosticListener listener) { | 841 AbstractFieldElement cloneTo(Element enclosing, DiagnosticListener listener) { |
842 listener.cancel("Cannot clone synthetic AbstractFieldElement", | 842 listener.cancel("Cannot clone synthetic AbstractFieldElement", |
843 element: this); | 843 element: this); |
844 } | 844 } |
845 } | 845 } |
846 | 846 |
847 // TODO(johnniwinther): [FunctionSignature] should be merged with | 847 // TODO(johnniwinther): [FunctionSignature] should be merged with |
848 // [FunctionType]. | 848 // [FunctionType]. |
849 class FunctionSignature { | 849 class FunctionSignature { |
850 Link<Element> requiredParameters; | 850 final Link<Element> requiredParameters; |
851 Link<Element> optionalParameters; | 851 final Link<Element> optionalParameters; |
852 DartType returnType; | 852 final DartType returnType; |
853 int requiredParameterCount; | 853 final int requiredParameterCount; |
854 int optionalParameterCount; | 854 final int optionalParameterCount; |
| 855 final bool optionalParametersAreNamed; |
855 FunctionSignature(this.requiredParameters, | 856 FunctionSignature(this.requiredParameters, |
856 this.optionalParameters, | 857 this.optionalParameters, |
857 this.requiredParameterCount, | 858 this.requiredParameterCount, |
858 this.optionalParameterCount, | 859 this.optionalParameterCount, |
| 860 this.optionalParametersAreNamed, |
859 this.returnType); | 861 this.returnType); |
860 | 862 |
861 void forEachRequiredParameter(void function(Element parameter)) { | 863 void forEachRequiredParameter(void function(Element parameter)) { |
862 for (Link<Element> link = requiredParameters; | 864 for (Link<Element> link = requiredParameters; |
863 !link.isEmpty(); | 865 !link.isEmpty(); |
864 link = link.tail) { | 866 link = link.tail) { |
865 function(link.head); | 867 function(link.head); |
866 } | 868 } |
867 } | 869 } |
868 | 870 |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1689 | 1691 |
1690 MetadataAnnotation ensureResolved(Compiler compiler) { | 1692 MetadataAnnotation ensureResolved(Compiler compiler) { |
1691 if (resolutionState == STATE_NOT_STARTED) { | 1693 if (resolutionState == STATE_NOT_STARTED) { |
1692 compiler.resolver.resolveMetadataAnnotation(this); | 1694 compiler.resolver.resolveMetadataAnnotation(this); |
1693 } | 1695 } |
1694 return this; | 1696 return this; |
1695 } | 1697 } |
1696 | 1698 |
1697 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 1699 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
1698 } | 1700 } |
OLD | NEW |