Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: pkg/compiler/lib/src/serialization/serialization_util.dart

Issue 2647043002: Fix hints reported by analyzer. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 Key.NAMED_ARGUMENTS, selector.callStructure.namedArguments); 45 Key.NAMED_ARGUMENTS, selector.callStructure.namedArguments);
46 serializeName(selector.memberName, encoder); 46 serializeName(selector.memberName, encoder);
47 } 47 }
48 48
49 /// Deserialize a [Selector] from [decoder]. 49 /// Deserialize a [Selector] from [decoder].
50 Selector deserializeSelector(ObjectDecoder decoder) { 50 Selector deserializeSelector(ObjectDecoder decoder) {
51 SelectorKind kind = decoder.getEnum(Key.KIND, SelectorKind.values); 51 SelectorKind kind = decoder.getEnum(Key.KIND, SelectorKind.values);
52 int argumentCount = decoder.getInt(Key.ARGUMENTS); 52 int argumentCount = decoder.getInt(Key.ARGUMENTS);
53 List<String> namedArguments = 53 List<String> namedArguments =
54 decoder.getStrings(Key.NAMED_ARGUMENTS, isOptional: true); 54 decoder.getStrings(Key.NAMED_ARGUMENTS, isOptional: true);
55 String name = decoder.getString(Key.NAME); 55 decoder.getString(Key.NAME);
Siggi Cherem (dart-lang) 2017/01/20 18:12:32 mmm... I'm guessing we should delete these 3 lines
Johnni Winther 2017/01/23 09:31:55 Yes, delete.
ahe 2017/01/23 10:58:36 Done.
56 bool isSetter = decoder.getBool(Key.IS_SETTER); 56 decoder.getBool(Key.IS_SETTER);
57 LibraryElement library = decoder.getElement(Key.LIBRARY, isOptional: true); 57 decoder.getElement(Key.LIBRARY, isOptional: true);
58 return new Selector(kind, deserializeName(decoder), 58 return new Selector(kind, deserializeName(decoder),
59 new CallStructure(argumentCount, namedArguments)); 59 new CallStructure(argumentCount, namedArguments));
60 } 60 }
61 61
62 /// Serialize [sendStructure] into [encoder]. 62 /// Serialize [sendStructure] into [encoder].
63 void serializeSendStructure( 63 void serializeSendStructure(
64 SendStructure sendStructure, ObjectEncoder encoder) { 64 SendStructure sendStructure, ObjectEncoder encoder) {
65 encoder.setEnum(Key.KIND, sendStructure.kind); 65 encoder.setEnum(Key.KIND, sendStructure.kind);
66 switch (sendStructure.kind) { 66 switch (sendStructure.kind) {
67 case SendStructureKind.IF_NULL: 67 case SendStructureKind.IF_NULL:
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 ObjectDecoder sourceSpanDecoder = 582 ObjectDecoder sourceSpanDecoder =
583 object.getObject(Key.SOURCE_SPAN, isOptional: true); 583 object.getObject(Key.SOURCE_SPAN, isOptional: true);
584 if (sourceSpanDecoder != null) { 584 if (sourceSpanDecoder != null) {
585 sourceSpan = deserializeSourceSpan(sourceSpanDecoder); 585 sourceSpan = deserializeSourceSpan(sourceSpanDecoder);
586 } 586 }
587 MessageKind messageKind = object.getEnum(Key.KIND, MessageKind.values); 587 MessageKind messageKind = object.getEnum(Key.KIND, MessageKind.values);
588 Map<String, dynamic> messageArguments = 588 Map<String, dynamic> messageArguments =
589 deserializeMessageArguments(object, Key.ARGUMENTS); 589 deserializeMessageArguments(object, Key.ARGUMENTS);
590 return new WrappedMessage(sourceSpan, messageKind, messageArguments); 590 return new WrappedMessage(sourceSpan, messageKind, messageArguments);
591 } 591 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698