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 dart2js.typechecker; | 5 library dart2js.typechecker; |
6 | 6 |
7 import 'common/names.dart' show Identifiers; | 7 import 'common/names.dart' show Identifiers; |
8 import 'common/resolution.dart' show Resolution; | 8 import 'common/resolution.dart' show Resolution; |
9 import 'common/tasks.dart' show CompilerTask; | 9 import 'common/tasks.dart' show CompilerTask; |
10 import 'common.dart'; | 10 import 'common.dart'; |
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 return new TypeLiteralAccess(elements.getTypeLiteralType(node)); | 1050 return new TypeLiteralAccess(elements.getTypeLiteralType(node)); |
1051 } | 1051 } |
1052 return createResolvedAccess(node, name, element); | 1052 return createResolvedAccess(node, name, element); |
1053 } else if (element.isClassMember) { | 1053 } else if (element.isClassMember) { |
1054 // foo() where foo is a member. | 1054 // foo() where foo is a member. |
1055 return lookupMember(node, thisType, name, memberKind, null, | 1055 return lookupMember(node, thisType, name, memberKind, null, |
1056 lookupClassMember: element.isStatic); | 1056 lookupClassMember: element.isStatic); |
1057 } else if (element.isFunction) { | 1057 } else if (element.isFunction) { |
1058 // foo() where foo is a method in the same class. | 1058 // foo() where foo is a method in the same class. |
1059 return createResolvedAccess(node, name, element); | 1059 return createResolvedAccess(node, name, element); |
1060 } else if (element.isVariable || | 1060 } else if (element.isVariable || element.isParameter || element.isField) { |
1061 element.isParameter || | |
1062 element.isField || | |
1063 element.isInitializingFormal) { | |
1064 // foo() where foo is a field in the same class. | 1061 // foo() where foo is a field in the same class. |
1065 return createResolvedAccess(node, name, element); | 1062 return createResolvedAccess(node, name, element); |
1066 } else if (element.isGetter || element.isSetter) { | 1063 } else if (element.isGetter || element.isSetter) { |
1067 return createResolvedAccess(node, name, element); | 1064 return createResolvedAccess(node, name, element); |
1068 } else { | 1065 } else { |
1069 reporter.internalError( | 1066 reporter.internalError( |
1070 element, 'Unexpected element kind ${element.kind}.'); | 1067 element, 'Unexpected element kind ${element.kind}.'); |
1071 return null; | 1068 return null; |
1072 } | 1069 } |
1073 } | 1070 } |
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2026 | 2023 |
2027 visitTypedef(Typedef node) { | 2024 visitTypedef(Typedef node) { |
2028 // Do not typecheck [Typedef] nodes. | 2025 // Do not typecheck [Typedef] nodes. |
2029 } | 2026 } |
2030 | 2027 |
2031 visitNode(Node node) { | 2028 visitNode(Node node) { |
2032 reporter.internalError(node, | 2029 reporter.internalError(node, |
2033 'Unexpected node ${node.getObjectDescription()} in the type checker.'); | 2030 'Unexpected node ${node.getObjectDescription()} in the type checker.'); |
2034 } | 2031 } |
2035 } | 2032 } |
OLD | NEW |