| 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 /// Entity model for elements derived from Kernel IR. | 5 /// Entity model for elements derived from Kernel IR. |
| 6 | 6 |
| 7 import '../elements/elements.dart'; | 7 import '../elements/elements.dart'; |
| 8 import '../elements/entities.dart'; | 8 import '../elements/entities.dart'; |
| 9 | 9 |
| 10 class KLibrary implements LibraryEntity { | 10 class KLibrary implements LibraryEntity { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 String get name => _name.text; | 50 String get name => _name.text; |
| 51 | 51 |
| 52 @override | 52 @override |
| 53 bool get isAssignable => false; | 53 bool get isAssignable => false; |
| 54 | 54 |
| 55 @override | 55 @override |
| 56 bool get isConst => false; | 56 bool get isConst => false; |
| 57 | 57 |
| 58 @override | 58 @override |
| 59 bool get isAbstract => false; |
| 60 |
| 61 @override |
| 59 bool get isSetter => false; | 62 bool get isSetter => false; |
| 60 | 63 |
| 61 @override | 64 @override |
| 62 bool get isGetter => false; | 65 bool get isGetter => false; |
| 63 | 66 |
| 64 @override | 67 @override |
| 65 bool get isFunction => false; | 68 bool get isFunction => false; |
| 66 | 69 |
| 67 @override | 70 @override |
| 68 bool get isField => false; | 71 bool get isField => false; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 isExternal: isExternal, isConst: isConst); | 139 isExternal: isExternal, isConst: isConst); |
| 137 | 140 |
| 138 @override | 141 @override |
| 139 bool get isFactoryConstructor => true; | 142 bool get isFactoryConstructor => true; |
| 140 | 143 |
| 141 @override | 144 @override |
| 142 bool get isGenerativeConstructor => false; | 145 bool get isGenerativeConstructor => false; |
| 143 } | 146 } |
| 144 | 147 |
| 145 class KMethod extends KFunction { | 148 class KMethod extends KFunction { |
| 149 final bool isAbstract; |
| 150 |
| 146 KMethod(int memberIndex, KLibrary library, KClass enclosingClass, Name name, | 151 KMethod(int memberIndex, KLibrary library, KClass enclosingClass, Name name, |
| 147 {bool isStatic, bool isExternal}) | 152 {bool isStatic, bool isExternal, this.isAbstract}) |
| 148 : super(memberIndex, library, enclosingClass, name, | 153 : super(memberIndex, library, enclosingClass, name, |
| 149 isStatic: isStatic, isExternal: isExternal); | 154 isStatic: isStatic, isExternal: isExternal); |
| 150 | 155 |
| 151 @override | 156 @override |
| 152 bool get isFunction => true; | 157 bool get isFunction => true; |
| 153 | 158 |
| 154 String get _kind => 'method'; | 159 String get _kind => 'method'; |
| 155 } | 160 } |
| 156 | 161 |
| 157 class KGetter extends KFunction { | 162 class KGetter extends KFunction { |
| 163 final bool isAbstract; |
| 164 |
| 158 KGetter(int memberIndex, KLibrary library, KClass enclosingClass, Name name, | 165 KGetter(int memberIndex, KLibrary library, KClass enclosingClass, Name name, |
| 159 {bool isStatic, bool isExternal}) | 166 {bool isStatic, bool isExternal, this.isAbstract}) |
| 160 : super(memberIndex, library, enclosingClass, name, | 167 : super(memberIndex, library, enclosingClass, name, |
| 161 isStatic: isStatic, isExternal: isExternal); | 168 isStatic: isStatic, isExternal: isExternal); |
| 162 | 169 |
| 163 @override | 170 @override |
| 164 bool get isGetter => true; | 171 bool get isGetter => true; |
| 165 | 172 |
| 166 String get _kind => 'getter'; | 173 String get _kind => 'getter'; |
| 167 } | 174 } |
| 168 | 175 |
| 169 class KSetter extends KFunction { | 176 class KSetter extends KFunction { |
| 177 final bool isAbstract; |
| 178 |
| 170 KSetter(int memberIndex, KLibrary library, KClass enclosingClass, Name name, | 179 KSetter(int memberIndex, KLibrary library, KClass enclosingClass, Name name, |
| 171 {bool isStatic, bool isExternal}) | 180 {bool isStatic, bool isExternal, this.isAbstract}) |
| 172 : super(memberIndex, library, enclosingClass, name, | 181 : super(memberIndex, library, enclosingClass, name, |
| 173 isStatic: isStatic, isExternal: isExternal); | 182 isStatic: isStatic, isExternal: isExternal); |
| 174 | 183 |
| 175 @override | 184 @override |
| 176 bool get isAssignable => true; | 185 bool get isAssignable => true; |
| 177 | 186 |
| 178 @override | 187 @override |
| 179 bool get isSetter => true; | 188 bool get isSetter => true; |
| 180 | 189 |
| 181 String get _kind => 'setter'; | 190 String get _kind => 'setter'; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 208 class KLocalFunction implements Local { | 217 class KLocalFunction implements Local { |
| 209 final String name; | 218 final String name; |
| 210 final MemberEntity memberContext; | 219 final MemberEntity memberContext; |
| 211 final Entity executableContext; | 220 final Entity executableContext; |
| 212 | 221 |
| 213 KLocalFunction(this.name, this.memberContext, this.executableContext); | 222 KLocalFunction(this.name, this.memberContext, this.executableContext); |
| 214 | 223 |
| 215 String toString() => | 224 String toString() => |
| 216 'local_function(${memberContext.name}.${name ?? '<anonymous>'})'; | 225 'local_function(${memberContext.name}.${name ?? '<anonymous>'})'; |
| 217 } | 226 } |
| OLD | NEW |