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

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

Issue 2099703002: Support malformed types (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/serialization/type_serialization.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 '../constants/constructors.dart'; 8 import '../constants/constructors.dart';
9 import '../constants/expressions.dart'; 9 import '../constants/expressions.dart';
10 import '../dart_types.dart'; 10 import '../dart_types.dart';
11 import '../diagnostics/messages.dart';
11 import '../elements/elements.dart'; 12 import '../elements/elements.dart';
12 import '../elements/modelx.dart' show ErroneousElementX; 13 import '../elements/modelx.dart' show ErroneousElementX;
13 import 'constant_serialization.dart'; 14 import 'constant_serialization.dart';
14 import 'keys.dart'; 15 import 'keys.dart';
15 import 'modelz.dart'; 16 import 'modelz.dart';
16 import 'serialization.dart'; 17 import 'serialization.dart';
17 import 'serialization_util.dart'; 18 import 'serialization_util.dart';
18 19
19 /// Enum kinds used for encoding [Element]s. 20 /// Enum kinds used for encoding [Element]s.
20 enum SerializedElementKind { 21 enum SerializedElementKind {
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 return null; 207 return null;
207 } 208 }
208 209
209 void serialize(ErroneousElement element, ObjectEncoder encoder, 210 void serialize(ErroneousElement element, ObjectEncoder encoder,
210 SerializedElementKind kind) { 211 SerializedElementKind kind) {
211 encoder.setElement(Key.ENCLOSING, element.enclosingElement); 212 encoder.setElement(Key.ENCLOSING, element.enclosingElement);
212 encoder.setString(Key.NAME, element.name); 213 encoder.setString(Key.NAME, element.name);
213 encoder.setEnum(Key.MESSAGE_KIND, element.messageKind); 214 encoder.setEnum(Key.MESSAGE_KIND, element.messageKind);
214 if (element.messageArguments.isNotEmpty) { 215 if (element.messageArguments.isNotEmpty) {
215 MapEncoder mapEncoder = encoder.createMap(Key.ARGUMENTS); 216 MapEncoder mapEncoder = encoder.createMap(Key.ARGUMENTS);
216 element.messageArguments.forEach((String key, String value) { 217 element.messageArguments.forEach((String key, var value) {
217 mapEncoder.setString(key, value); 218 mapEncoder.setString(key, Message.convertToString(value));
218 }); 219 });
219 } 220 }
220 } 221 }
221 } 222 }
222 223
223 class LibrarySerializer implements ElementSerializer { 224 class LibrarySerializer implements ElementSerializer {
224 const LibrarySerializer(); 225 const LibrarySerializer();
225 226
226 SerializedElementKind getSerializedKind(Element element) { 227 SerializedElementKind getSerializedKind(Element element) {
227 if (element.isLibrary) { 228 if (element.isLibrary) {
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 return new LocalVariableElementZ(decoder); 813 return new LocalVariableElementZ(decoder);
813 case SerializedElementKind.EXTERNAL_LIBRARY: 814 case SerializedElementKind.EXTERNAL_LIBRARY:
814 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: 815 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER:
815 case SerializedElementKind.EXTERNAL_CLASS_MEMBER: 816 case SerializedElementKind.EXTERNAL_CLASS_MEMBER:
816 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: 817 case SerializedElementKind.EXTERNAL_CONSTRUCTOR:
817 break; 818 break;
818 } 819 }
819 throw new UnsupportedError("Unexpected element kind '${elementKind}."); 820 throw new UnsupportedError("Unexpected element kind '${elementKind}.");
820 } 821 }
821 } 822 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/serialization/type_serialization.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698