| 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 dart2js.serialization.util; | 5 library dart2js.serialization.util; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
| 9 import '../elements/resolution_types.dart'; | 9 import '../elements/resolution_types.dart'; |
| 10 import '../diagnostics/messages.dart'; | 10 import '../diagnostics/messages.dart'; |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 343 } |
| 344 | 344 |
| 345 /// Deserialize a [NewStructure] from [decoder]. | 345 /// Deserialize a [NewStructure] from [decoder]. |
| 346 NewStructure deserializeNewStructure(ObjectDecoder decoder) { | 346 NewStructure deserializeNewStructure(ObjectDecoder decoder) { |
| 347 NewStructureKind kind = decoder.getEnum(Key.KIND, NewStructureKind.values); | 347 NewStructureKind kind = decoder.getEnum(Key.KIND, NewStructureKind.values); |
| 348 switch (kind) { | 348 switch (kind) { |
| 349 case NewStructureKind.NEW_INVOKE: | 349 case NewStructureKind.NEW_INVOKE: |
| 350 ConstructorAccessKind constructorAccessKind = | 350 ConstructorAccessKind constructorAccessKind = |
| 351 decoder.getEnum(Key.SUB_KIND, ConstructorAccessKind.values); | 351 decoder.getEnum(Key.SUB_KIND, ConstructorAccessKind.values); |
| 352 Element element = decoder.getElement(Key.ELEMENT); | 352 Element element = decoder.getElement(Key.ELEMENT); |
| 353 DartType type = decoder.getType(Key.TYPE); | 353 ResolutionDartType type = decoder.getType(Key.TYPE); |
| 354 ConstructorAccessSemantics semantics = | 354 ConstructorAccessSemantics semantics = |
| 355 new ConstructorAccessSemantics(constructorAccessKind, element, type); | 355 new ConstructorAccessSemantics(constructorAccessKind, element, type); |
| 356 Selector selector = deserializeSelector(decoder.getObject(Key.SELECTOR)); | 356 Selector selector = deserializeSelector(decoder.getObject(Key.SELECTOR)); |
| 357 return new NewInvokeStructure(semantics, selector); | 357 return new NewInvokeStructure(semantics, selector); |
| 358 | 358 |
| 359 case NewStructureKind.CONST_INVOKE: | 359 case NewStructureKind.CONST_INVOKE: |
| 360 ConstantInvokeKind constantInvokeKind = | 360 ConstantInvokeKind constantInvokeKind = |
| 361 decoder.getEnum(Key.SUB_KIND, ConstantInvokeKind.values); | 361 decoder.getEnum(Key.SUB_KIND, ConstantInvokeKind.values); |
| 362 ConstantExpression constant = decoder.getConstant(Key.CONSTANT); | 362 ConstantExpression constant = decoder.getConstant(Key.CONSTANT); |
| 363 return new ConstInvokeStructure(constantInvokeKind, constant); | 363 return new ConstInvokeStructure(constantInvokeKind, constant); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 ObjectDecoder sourceSpanDecoder = | 581 ObjectDecoder sourceSpanDecoder = |
| 582 object.getObject(Key.SOURCE_SPAN, isOptional: true); | 582 object.getObject(Key.SOURCE_SPAN, isOptional: true); |
| 583 if (sourceSpanDecoder != null) { | 583 if (sourceSpanDecoder != null) { |
| 584 sourceSpan = deserializeSourceSpan(sourceSpanDecoder); | 584 sourceSpan = deserializeSourceSpan(sourceSpanDecoder); |
| 585 } | 585 } |
| 586 MessageKind messageKind = object.getEnum(Key.KIND, MessageKind.values); | 586 MessageKind messageKind = object.getEnum(Key.KIND, MessageKind.values); |
| 587 Map<String, dynamic> messageArguments = | 587 Map<String, dynamic> messageArguments = |
| 588 deserializeMessageArguments(object, Key.ARGUMENTS); | 588 deserializeMessageArguments(object, Key.ARGUMENTS); |
| 589 return new WrappedMessage(sourceSpan, messageKind, messageArguments); | 589 return new WrappedMessage(sourceSpan, messageKind, messageArguments); |
| 590 } | 590 } |
| OLD | NEW |