| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer.src.dart.element.builder; | 5 library analyzer.src.dart.element.builder; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 } | 969 } |
| 970 if (node.returnType == null) { | 970 if (node.returnType == null) { |
| 971 element.hasImplicitReturnType = true; | 971 element.hasImplicitReturnType = true; |
| 972 } | 972 } |
| 973 _currentHolder.addMethod(element); | 973 _currentHolder.addMethod(element); |
| 974 methodName.staticElement = element; | 974 methodName.staticElement = element; |
| 975 } else { | 975 } else { |
| 976 SimpleIdentifier propertyNameNode = node.name; | 976 SimpleIdentifier propertyNameNode = node.name; |
| 977 String propertyName = propertyNameNode.name; | 977 String propertyName = propertyNameNode.name; |
| 978 FieldElementImpl field = | 978 FieldElementImpl field = |
| 979 _currentHolder.getField(propertyName) as FieldElementImpl; | 979 _currentHolder.getField(propertyName, synthetic: true) as FieldEleme
ntImpl; |
| 980 if (field == null) { | 980 if (field == null) { |
| 981 field = new FieldElementImpl(node.name.name, -1); | 981 field = new FieldElementImpl(node.name.name, -1); |
| 982 field.final2 = true; | 982 field.final2 = true; |
| 983 field.static = isStatic; | 983 field.static = isStatic; |
| 984 field.synthetic = true; | 984 field.synthetic = true; |
| 985 _currentHolder.addField(field); | 985 _currentHolder.addField(field); |
| 986 } | 986 } |
| 987 if (node.isGetter) { | 987 if (node.isGetter) { |
| 988 PropertyAccessorElementImpl getter = | 988 PropertyAccessorElementImpl getter = |
| 989 new PropertyAccessorElementImpl.forNode(propertyNameNode); | 989 new PropertyAccessorElementImpl.forNode(propertyNameNode); |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1457 return null; | 1457 return null; |
| 1458 } | 1458 } |
| 1459 | 1459 |
| 1460 /** | 1460 /** |
| 1461 * Return the lexical identifiers associated with the given [identifiers]. | 1461 * Return the lexical identifiers associated with the given [identifiers]. |
| 1462 */ | 1462 */ |
| 1463 static List<String> _getIdentifiers(NodeList<SimpleIdentifier> identifiers) { | 1463 static List<String> _getIdentifiers(NodeList<SimpleIdentifier> identifiers) { |
| 1464 return identifiers.map((identifier) => identifier.name).toList(); | 1464 return identifiers.map((identifier) => identifier.name).toList(); |
| 1465 } | 1465 } |
| 1466 } | 1466 } |
| OLD | NEW |