OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.dill_member_builder; | 5 library fasta.dill_member_builder; |
6 | 6 |
7 import 'package:kernel/ast.dart' | 7 import 'package:kernel/ast.dart' |
8 show Constructor, Field, Member, Procedure, ProcedureKind; | 8 show Constructor, Field, Member, Procedure, ProcedureKind; |
9 | 9 |
10 import '../errors.dart' show internalError; | 10 import '../errors.dart' show internalError; |
(...skipping 10 matching lines...) Expand all Loading... |
21 class DillMemberBuilder extends MemberBuilder { | 21 class DillMemberBuilder extends MemberBuilder { |
22 final int modifiers; | 22 final int modifiers; |
23 | 23 |
24 final Member member; | 24 final Member member; |
25 | 25 |
26 DillMemberBuilder(Member member, Builder parent) | 26 DillMemberBuilder(Member member, Builder parent) |
27 : modifiers = computeModifiers(member), | 27 : modifiers = computeModifiers(member), |
28 member = member, | 28 member = member, |
29 super(parent, member.fileOffset); | 29 super(parent, member.fileOffset); |
30 | 30 |
| 31 String get debugName => "DillMemberBuilder"; |
| 32 |
31 Member get target => member; | 33 Member get target => member; |
32 | 34 |
33 String get name => member.name.name; | 35 String get name => member.name.name; |
34 | 36 |
35 bool get isConstructor => member is Constructor; | 37 bool get isConstructor => member is Constructor; |
36 | 38 |
37 ProcedureKind get kind { | 39 ProcedureKind get kind { |
38 final member = this.member; | 40 final member = this.member; |
39 return member is Procedure ? member.kind : null; | 41 return member is Procedure ? member.kind : null; |
40 } | 42 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 } else if (member is Procedure) { | 74 } else if (member is Procedure) { |
73 modifier |= member.isConst ? constMask : 0; | 75 modifier |= member.isConst ? constMask : 0; |
74 modifier |= member.isStatic ? staticMask : 0; | 76 modifier |= member.isStatic ? staticMask : 0; |
75 } else if (member is Constructor) { | 77 } else if (member is Constructor) { |
76 modifier |= member.isConst ? constMask : 0; | 78 modifier |= member.isConst ? constMask : 0; |
77 } else { | 79 } else { |
78 internalError("Unhandled: ${member.runtimeType}"); | 80 internalError("Unhandled: ${member.runtimeType}"); |
79 } | 81 } |
80 return modifier; | 82 return modifier; |
81 } | 83 } |
OLD | NEW |