OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dart2js.serialization.elements; | 5 library dart2js.serialization.elements; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../constants/constructors.dart'; | 8 import '../constants/constructors.dart'; |
9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 List<InterfaceType> mixins = <InterfaceType>[]; | 301 List<InterfaceType> mixins = <InterfaceType>[]; |
302 ClassElement superclass = element.superclass; | 302 ClassElement superclass = element.superclass; |
303 while (superclass.isUnnamedMixinApplication) { | 303 while (superclass.isUnnamedMixinApplication) { |
304 MixinApplicationElement mixinElement = superclass; | 304 MixinApplicationElement mixinElement = superclass; |
305 mixins.add(element.thisType.asInstanceOf(mixinElement.mixin)); | 305 mixins.add(element.thisType.asInstanceOf(mixinElement.mixin)); |
306 superclass = mixinElement.superclass; | 306 superclass = mixinElement.superclass; |
307 } | 307 } |
308 mixins = mixins.reversed.toList(); | 308 mixins = mixins.reversed.toList(); |
309 InterfaceType supertype = element.thisType.asInstanceOf(superclass); | 309 InterfaceType supertype = element.thisType.asInstanceOf(superclass); |
310 | 310 |
311 | |
312 encoder.setType(Key.SUPERTYPE, supertype); | 311 encoder.setType(Key.SUPERTYPE, supertype); |
313 encoder.setTypes(Key.MIXINS, mixins); | 312 encoder.setTypes(Key.MIXINS, mixins); |
314 encoder.setTypes(Key.INTERFACES, element.interfaces.toList()); | 313 encoder.setTypes(Key.INTERFACES, element.interfaces.toList()); |
| 314 FunctionType callType = element.declaration.callType; |
| 315 if (callType != null) { |
| 316 encoder.setType(Key.CALL_TYPE, element.callType); |
| 317 } |
315 | 318 |
316 if (element.isMixinApplication) { | 319 if (element.isMixinApplication) { |
317 MixinApplicationElement mixinElement = element; | 320 MixinApplicationElement mixinElement = element; |
318 encoder.setType(Key.MIXIN, mixinElement.mixinType); | 321 encoder.setType(Key.MIXIN, mixinElement.mixinType); |
319 } | 322 } |
320 } | 323 } |
321 } | 324 } |
322 | 325 |
323 class ConstructorSerializer implements ElementSerializer { | 326 class ConstructorSerializer implements ElementSerializer { |
324 const ConstructorSerializer(); | 327 const ConstructorSerializer(); |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 return new PrefixElementZ(decoder); | 660 return new PrefixElementZ(decoder); |
658 case SerializedElementKind.EXTERNAL_LIBRARY: | 661 case SerializedElementKind.EXTERNAL_LIBRARY: |
659 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: | 662 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: |
660 case SerializedElementKind.EXTERNAL_STATIC_MEMBER: | 663 case SerializedElementKind.EXTERNAL_STATIC_MEMBER: |
661 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: | 664 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: |
662 break; | 665 break; |
663 } | 666 } |
664 throw new UnsupportedError("Unexpected element kind '${elementKind}."); | 667 throw new UnsupportedError("Unexpected element kind '${elementKind}."); |
665 } | 668 } |
666 } | 669 } |
OLD | NEW |