| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 js_backend.serialization; | 5 library js_backend.serialization; |
| 6 | 6 |
| 7 import '../common/backend_api.dart' show BackendSerialization; | 7 import '../common/backend_api.dart' show BackendSerialization; |
| 8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
| 9 import '../elements/resolution_types.dart'; | 9 import '../elements/resolution_types.dart'; |
| 10 import '../elements/types.dart'; | 10 import '../elements/types.dart'; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 NativeBehavior nativeFieldStoreBehavior = | 100 NativeBehavior nativeFieldStoreBehavior = |
| 101 nativeData.nativeFieldStoreBehavior[element]; | 101 nativeData.nativeFieldStoreBehavior[element]; |
| 102 if (nativeFieldStoreBehavior != null) { | 102 if (nativeFieldStoreBehavior != null) { |
| 103 NativeBehaviorSerialization.serializeNativeBehavior( | 103 NativeBehaviorSerialization.serializeNativeBehavior( |
| 104 nativeFieldStoreBehavior, | 104 nativeFieldStoreBehavior, |
| 105 getEncoder().createObject(NATIVE_FIELD_STORE_BEHAVIOR)); | 105 getEncoder().createObject(NATIVE_FIELD_STORE_BEHAVIOR)); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 @override | 109 @override |
| 110 void onData(NativeBehavior behavior, ObjectEncoder encoder) { | 110 void onData(covariant NativeBehavior behavior, ObjectEncoder encoder) { |
| 111 NativeBehaviorSerialization.serializeNativeBehavior(behavior, encoder); | 111 NativeBehaviorSerialization.serializeNativeBehavior(behavior, encoder); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 class JavaScriptBackendDeserializer implements DeserializerPlugin { | 115 class JavaScriptBackendDeserializer implements DeserializerPlugin { |
| 116 final JavaScriptBackend _backend; | 116 final JavaScriptBackend _backend; |
| 117 | 117 |
| 118 JavaScriptBackendDeserializer(this._backend); | 118 JavaScriptBackendDeserializer(this._backend); |
| 119 | 119 |
| 120 NativeBasicDataBuilderImpl get nativeBasicData => | 120 NativeBasicDataBuilderImpl get nativeBasicData => |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 behavior.codeTemplate = js.js.parseForeignJS(behavior.codeTemplateText); | 288 behavior.codeTemplate = js.js.parseForeignJS(behavior.codeTemplateText); |
| 289 } | 289 } |
| 290 | 290 |
| 291 behavior.throwBehavior = | 291 behavior.throwBehavior = |
| 292 decoder.getEnum(THROW_BEHAVIOR, NativeThrowBehavior.values); | 292 decoder.getEnum(THROW_BEHAVIOR, NativeThrowBehavior.values); |
| 293 behavior.isAllocation = decoder.getBool(IS_ALLOCATION); | 293 behavior.isAllocation = decoder.getBool(IS_ALLOCATION); |
| 294 behavior.useGvn = decoder.getBool(USE_GVN); | 294 behavior.useGvn = decoder.getBool(USE_GVN); |
| 295 return behavior; | 295 return behavior; |
| 296 } | 296 } |
| 297 } | 297 } |
| OLD | NEW |