| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
| 6 | 6 |
| 7 import '../closure.dart'; | 7 import '../closure.dart'; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../constants/values.dart'; | 9 import '../constants/values.dart'; |
| 10 import '../common_elements.dart'; | 10 import '../common_elements.dart'; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 ir.Node get node; | 237 ir.Node get node; |
| 238 | 238 |
| 239 /// The canonical location of [member]. This is used for sorting the members | 239 /// The canonical location of [member]. This is used for sorting the members |
| 240 /// in the emitted code. | 240 /// in the emitted code. |
| 241 SourceSpan get location; | 241 SourceSpan get location; |
| 242 } | 242 } |
| 243 | 243 |
| 244 enum ClassKind { | 244 enum ClassKind { |
| 245 regular, | 245 regular, |
| 246 closure, | 246 closure, |
| 247 // TODO(efortuna, johnniwinther): Container is not a class, but is |
| 248 // masquerading as one currently for consistency with the old element model. |
| 249 record, |
| 247 } | 250 } |
| 248 | 251 |
| 249 /// A member directly defined by its [ir.Member] node. | 252 /// A member directly defined by its [ir.Member] node. |
| 250 class RegularMemberDefinition implements MemberDefinition { | 253 class RegularMemberDefinition implements MemberDefinition { |
| 251 final MemberEntity member; | 254 final MemberEntity member; |
| 252 final ir.Member node; | 255 final ir.Member node; |
| 253 | 256 |
| 254 RegularMemberDefinition(this.member, this.node); | 257 RegularMemberDefinition(this.member, this.node); |
| 255 | 258 |
| 256 SourceSpan get location => computeSourceSpanFromTreeNode(node); | 259 SourceSpan get location => computeSourceSpanFromTreeNode(node); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 uri = Uri.parse(node.location.file); | 460 uri = Uri.parse(node.location.file); |
| 458 break; | 461 break; |
| 459 } | 462 } |
| 460 node = node.parent; | 463 node = node.parent; |
| 461 } | 464 } |
| 462 if (uri != null) { | 465 if (uri != null) { |
| 463 return new SourceSpan(uri, offset, offset + 1); | 466 return new SourceSpan(uri, offset, offset + 1); |
| 464 } | 467 } |
| 465 return null; | 468 return null; |
| 466 } | 469 } |
| OLD | NEW |