| 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 } | 374 } |
| 375 return null; | 375 return null; |
| 376 } | 376 } |
| 377 | 377 |
| 378 void serialize(TypeVariableElement element, | 378 void serialize(TypeVariableElement element, |
| 379 ObjectEncoder encoder, | 379 ObjectEncoder encoder, |
| 380 SerializedElementKind kind) { | 380 SerializedElementKind kind) { |
| 381 encoder.setElement(Key.TYPE_DECLARATION, element.typeDeclaration); | 381 encoder.setElement(Key.TYPE_DECLARATION, element.typeDeclaration); |
| 382 encoder.setString(Key.NAME, element.name); | 382 encoder.setString(Key.NAME, element.name); |
| 383 SerializerUtil.serializePosition(element, encoder); | 383 SerializerUtil.serializePosition(element, encoder); |
| 384 TypeDeclarationElement typeDeclaration = element.typeDeclaration; | |
| 385 encoder.setType(Key.TYPE, element.type); | 384 encoder.setType(Key.TYPE, element.type); |
| 386 encoder.setInt(Key.INDEX, element.index); | 385 encoder.setInt(Key.INDEX, element.index); |
| 387 encoder.setType(Key.BOUND, element.bound); | 386 encoder.setType(Key.BOUND, element.bound); |
| 388 } | 387 } |
| 389 } | 388 } |
| 390 | 389 |
| 391 class ParameterSerializer implements ElementSerializer { | 390 class ParameterSerializer implements ElementSerializer { |
| 392 const ParameterSerializer(); | 391 const ParameterSerializer(); |
| 393 | 392 |
| 394 SerializedElementKind getSerializedKind(Element element) { | 393 SerializedElementKind getSerializedKind(Element element) { |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 case SerializedElementKind.IMPORT: | 547 case SerializedElementKind.IMPORT: |
| 549 return new ImportElementZ(decoder); | 548 return new ImportElementZ(decoder); |
| 550 case SerializedElementKind.EXPORT: | 549 case SerializedElementKind.EXPORT: |
| 551 return new ExportElementZ(decoder); | 550 return new ExportElementZ(decoder); |
| 552 case SerializedElementKind.PREFIX: | 551 case SerializedElementKind.PREFIX: |
| 553 return new PrefixElementZ(decoder); | 552 return new PrefixElementZ(decoder); |
| 554 } | 553 } |
| 555 throw new UnsupportedError("Unexpected element kind '${elementKind}."); | 554 throw new UnsupportedError("Unexpected element kind '${elementKind}."); |
| 556 } | 555 } |
| 557 } | 556 } |
| OLD | NEW |