| 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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 encoder.setType(Key.TYPE, element.type); | 604 encoder.setType(Key.TYPE, element.type); |
| 605 encoder.setInt(Key.INDEX, element.index); | 605 encoder.setInt(Key.INDEX, element.index); |
| 606 encoder.setType(Key.BOUND, element.bound); | 606 encoder.setType(Key.BOUND, element.bound); |
| 607 } | 607 } |
| 608 } | 608 } |
| 609 | 609 |
| 610 class ParameterSerializer implements ElementSerializer { | 610 class ParameterSerializer implements ElementSerializer { |
| 611 const ParameterSerializer(); | 611 const ParameterSerializer(); |
| 612 | 612 |
| 613 SerializedElementKind getSerializedKind(Element element) { | 613 SerializedElementKind getSerializedKind(Element element) { |
| 614 if (element.isParameter) { | 614 if (element.isRegularParameter) { |
| 615 return SerializedElementKind.PARAMETER; | 615 return SerializedElementKind.PARAMETER; |
| 616 } else if (element.isInitializingFormal) { | 616 } else if (element.isInitializingFormal) { |
| 617 return SerializedElementKind.INITIALIZING_FORMAL; | 617 return SerializedElementKind.INITIALIZING_FORMAL; |
| 618 } | 618 } |
| 619 return null; | 619 return null; |
| 620 } | 620 } |
| 621 | 621 |
| 622 void serialize(ParameterElement element, ObjectEncoder encoder, | 622 void serialize(ParameterElement element, ObjectEncoder encoder, |
| 623 SerializedElementKind kind) { | 623 SerializedElementKind kind) { |
| 624 encoder.setElement(Key.FUNCTION, element.functionDeclaration); | 624 encoder.setElement(Key.FUNCTION, element.functionDeclaration); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 return new WarnOnUseElementX(warning, info, enclosing, element); | 868 return new WarnOnUseElementX(warning, info, enclosing, element); |
| 869 case SerializedElementKind.EXTERNAL_LIBRARY: | 869 case SerializedElementKind.EXTERNAL_LIBRARY: |
| 870 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: | 870 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: |
| 871 case SerializedElementKind.EXTERNAL_CLASS_MEMBER: | 871 case SerializedElementKind.EXTERNAL_CLASS_MEMBER: |
| 872 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: | 872 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: |
| 873 break; | 873 break; |
| 874 } | 874 } |
| 875 throw new UnsupportedError("Unexpected element kind '${elementKind}."); | 875 throw new UnsupportedError("Unexpected element kind '${elementKind}."); |
| 876 } | 876 } |
| 877 } | 877 } |
| OLD | NEW |