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 '../common/names.dart'; | 8 import '../common/names.dart'; |
9 import '../constants/constructors.dart'; | 9 import '../constants/constructors.dart'; |
10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 } | 549 } |
550 SerializerUtil.serializeParentRelation(element, encoder); | 550 SerializerUtil.serializeParentRelation(element, encoder); |
551 encoder.setBool(Key.IS_EXTERNAL, element.isExternal); | 551 encoder.setBool(Key.IS_EXTERNAL, element.isExternal); |
552 encoder.setBool(Key.IS_ABSTRACT, element.isAbstract); | 552 encoder.setBool(Key.IS_ABSTRACT, element.isAbstract); |
553 encoder.setBool(Key.IS_INJECTED, element.isInjected); | 553 encoder.setBool(Key.IS_INJECTED, element.isInjected); |
554 if (element.isLocal) { | 554 if (element.isLocal) { |
555 LocalFunctionElement localFunction = element; | 555 LocalFunctionElement localFunction = element; |
556 encoder.setElement( | 556 encoder.setElement( |
557 Key.EXECUTABLE_CONTEXT, localFunction.executableContext); | 557 Key.EXECUTABLE_CONTEXT, localFunction.executableContext); |
558 } | 558 } |
| 559 encoder.setTypes(Key.TYPE_VARIABLES, element.typeVariables); |
559 } | 560 } |
560 } | 561 } |
561 | 562 |
562 class TypedefSerializer implements ElementSerializer { | 563 class TypedefSerializer implements ElementSerializer { |
563 const TypedefSerializer(); | 564 const TypedefSerializer(); |
564 | 565 |
565 SerializedElementKind getSerializedKind(Element element) { | 566 SerializedElementKind getSerializedKind(Element element) { |
566 if (element.isTypedef) { | 567 if (element.isTypedef) { |
567 return SerializedElementKind.TYPEDEF; | 568 return SerializedElementKind.TYPEDEF; |
568 } | 569 } |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 return new LocalVariableElementZ(decoder); | 844 return new LocalVariableElementZ(decoder); |
844 case SerializedElementKind.EXTERNAL_LIBRARY: | 845 case SerializedElementKind.EXTERNAL_LIBRARY: |
845 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: | 846 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: |
846 case SerializedElementKind.EXTERNAL_CLASS_MEMBER: | 847 case SerializedElementKind.EXTERNAL_CLASS_MEMBER: |
847 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: | 848 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: |
848 break; | 849 break; |
849 } | 850 } |
850 throw new UnsupportedError("Unexpected element kind '${elementKind}."); | 851 throw new UnsupportedError("Unexpected element kind '${elementKind}."); |
851 } | 852 } |
852 } | 853 } |
OLD | NEW |