| 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 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 Link<Element> optionalParameters; | 838 Link<Element> optionalParameters; |
| 839 DartType returnType; | 839 DartType returnType; |
| 840 int requiredParameterCount; | 840 int requiredParameterCount; |
| 841 int optionalParameterCount; | 841 int optionalParameterCount; |
| 842 FunctionSignature(this.requiredParameters, | 842 FunctionSignature(this.requiredParameters, |
| 843 this.optionalParameters, | 843 this.optionalParameters, |
| 844 this.requiredParameterCount, | 844 this.requiredParameterCount, |
| 845 this.optionalParameterCount, | 845 this.optionalParameterCount, |
| 846 this.returnType); | 846 this.returnType); |
| 847 | 847 |
| 848 void forEachParameter(void function(Element parameter)) { | 848 void forEachRequiredParameter(void function(Element parameter)) { |
| 849 for (Link<Element> link = requiredParameters; | 849 for (Link<Element> link = requiredParameters; |
| 850 !link.isEmpty(); | 850 !link.isEmpty(); |
| 851 link = link.tail) { | 851 link = link.tail) { |
| 852 function(link.head); | 852 function(link.head); |
| 853 } | 853 } |
| 854 } |
| 855 |
| 856 void forEachOptionalParameter(void function(Element parameter)) { |
| 854 for (Link<Element> link = optionalParameters; | 857 for (Link<Element> link = optionalParameters; |
| 855 !link.isEmpty(); | 858 !link.isEmpty(); |
| 856 link = link.tail) { | 859 link = link.tail) { |
| 857 function(link.head); | 860 function(link.head); |
| 858 } | 861 } |
| 859 } | 862 } |
| 860 | 863 |
| 864 void forEachParameter(void function(Element parameter)) { |
| 865 forEachRequiredParameter(function); |
| 866 forEachOptionalParameter(function); |
| 867 } |
| 868 |
| 861 int get parameterCount => requiredParameterCount + optionalParameterCount; | 869 int get parameterCount => requiredParameterCount + optionalParameterCount; |
| 862 } | 870 } |
| 863 | 871 |
| 864 class FunctionElement extends Element { | 872 class FunctionElement extends Element { |
| 865 FunctionExpression cachedNode; | 873 FunctionExpression cachedNode; |
| 866 DartType type; | 874 DartType type; |
| 867 final Modifiers modifiers; | 875 final Modifiers modifiers; |
| 868 | 876 |
| 869 FunctionSignature functionSignature; | 877 FunctionSignature functionSignature; |
| 870 | 878 |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 | 1660 |
| 1653 MetadataAnnotation ensureResolved(Compiler compiler) { | 1661 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 1654 if (resolutionState == STATE_NOT_STARTED) { | 1662 if (resolutionState == STATE_NOT_STARTED) { |
| 1655 compiler.resolver.resolveMetadataAnnotation(this); | 1663 compiler.resolver.resolveMetadataAnnotation(this); |
| 1656 } | 1664 } |
| 1657 return this; | 1665 return this; |
| 1658 } | 1666 } |
| 1659 | 1667 |
| 1660 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 1668 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 1661 } | 1669 } |
| OLD | NEW |