Chromium Code Reviews| 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.element; | 5 library analyzer.src.dart.element.element; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:math' show min; | 8 import 'dart:math' show min; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1075 } | 1075 } |
| 1076 | 1076 |
| 1077 @override | 1077 @override |
| 1078 List<ClassElement> get types => _types; | 1078 List<ClassElement> get types => _types; |
| 1079 | 1079 |
| 1080 /** | 1080 /** |
| 1081 * Set the types contained in this compilation unit to the given [types]. | 1081 * Set the types contained in this compilation unit to the given [types]. |
| 1082 */ | 1082 */ |
| 1083 void set types(List<ClassElement> types) { | 1083 void set types(List<ClassElement> types) { |
| 1084 for (ClassElement type in types) { | 1084 for (ClassElement type in types) { |
| 1085 (type as ClassElementImpl).enclosingElement = this; | 1085 if (type is ClassElementImpl) { |
|
Paul Berry
2016/03/24 19:40:14
Nit: it's not obvious without reading the rest of
| |
| 1086 type.enclosingElement = this; | |
| 1087 } | |
| 1086 } | 1088 } |
| 1087 this._types = types; | 1089 this._types = types; |
| 1088 } | 1090 } |
| 1089 | 1091 |
| 1090 @override | 1092 @override |
| 1091 bool operator ==(Object object) => | 1093 bool operator ==(Object object) => |
| 1092 object is CompilationUnitElementImpl && source == object.source; | 1094 object is CompilationUnitElementImpl && source == object.source; |
| 1093 | 1095 |
| 1094 @override | 1096 @override |
| 1095 accept(ElementVisitor visitor) => visitor.visitCompilationUnitElement(this); | 1097 accept(ElementVisitor visitor) => visitor.visitCompilationUnitElement(this); |
| (...skipping 3848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4944 | 4946 |
| 4945 @override | 4947 @override |
| 4946 void visitElement(Element element) { | 4948 void visitElement(Element element) { |
| 4947 int offset = element.nameOffset; | 4949 int offset = element.nameOffset; |
| 4948 if (offset != -1) { | 4950 if (offset != -1) { |
| 4949 map[offset] = element; | 4951 map[offset] = element; |
| 4950 } | 4952 } |
| 4951 super.visitElement(element); | 4953 super.visitElement(element); |
| 4952 } | 4954 } |
| 4953 } | 4955 } |
| OLD | NEW |