| 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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 void serialize(FunctionElement element, ObjectEncoder encoder, | 537 void serialize(FunctionElement element, ObjectEncoder encoder, |
| 538 SerializedElementKind kind) { | 538 SerializedElementKind kind) { |
| 539 encoder.setString(Key.NAME, element.name); | 539 encoder.setString(Key.NAME, element.name); |
| 540 SerializerUtil.serializeMetadata(element, encoder); | 540 SerializerUtil.serializeMetadata(element, encoder); |
| 541 SerializerUtil.serializePosition(element, encoder); | 541 SerializerUtil.serializePosition(element, encoder); |
| 542 SerializerUtil.serializeParameters(element, encoder); | 542 SerializerUtil.serializeParameters(element, encoder); |
| 543 encoder.setType(Key.TYPE, element.type); | 543 encoder.setType(Key.TYPE, element.type); |
| 544 if (element.isFunction) { | 544 if (element.isFunction) { |
| 545 encoder.setBool(Key.IS_OPERATOR, element.isOperator); | 545 encoder.setBool(Key.IS_OPERATOR, element.isOperator); |
| 546 encoder.setEnum(Key.ASYNC_MARKER, element.asyncMarker); | 546 encoder.setEnum(Key.ASYNC_MARKER, element.asyncMarker); |
| 547 } else if (element.isGetter) { |
| 548 encoder.setEnum(Key.ASYNC_MARKER, element.asyncMarker); |
| 547 } | 549 } |
| 548 SerializerUtil.serializeParentRelation(element, encoder); | 550 SerializerUtil.serializeParentRelation(element, encoder); |
| 549 encoder.setBool(Key.IS_EXTERNAL, element.isExternal); | 551 encoder.setBool(Key.IS_EXTERNAL, element.isExternal); |
| 550 encoder.setBool(Key.IS_ABSTRACT, element.isAbstract); | 552 encoder.setBool(Key.IS_ABSTRACT, element.isAbstract); |
| 551 encoder.setBool(Key.IS_INJECTED, element.isInjected); | 553 encoder.setBool(Key.IS_INJECTED, element.isInjected); |
| 552 if (element.isLocal) { | 554 if (element.isLocal) { |
| 553 LocalFunctionElement localFunction = element; | 555 LocalFunctionElement localFunction = element; |
| 554 encoder.setElement( | 556 encoder.setElement( |
| 555 Key.EXECUTABLE_CONTEXT, localFunction.executableContext); | 557 Key.EXECUTABLE_CONTEXT, localFunction.executableContext); |
| 556 } | 558 } |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 return new LocalVariableElementZ(decoder); | 843 return new LocalVariableElementZ(decoder); |
| 842 case SerializedElementKind.EXTERNAL_LIBRARY: | 844 case SerializedElementKind.EXTERNAL_LIBRARY: |
| 843 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: | 845 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: |
| 844 case SerializedElementKind.EXTERNAL_CLASS_MEMBER: | 846 case SerializedElementKind.EXTERNAL_CLASS_MEMBER: |
| 845 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: | 847 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: |
| 846 break; | 848 break; |
| 847 } | 849 } |
| 848 throw new UnsupportedError("Unexpected element kind '${elementKind}."); | 850 throw new UnsupportedError("Unexpected element kind '${elementKind}."); |
| 849 } | 851 } |
| 850 } | 852 } |
| OLD | NEW |