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

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

Issue 2116483002: Handle constant ?? expressions in constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 | « pkg/compiler/lib/src/dart2js.dart ('k') | tests/compiler/dart2js/constant_expression_test.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 '../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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 encoder.setUri( 286 encoder.setUri(
287 Key.CANONICAL_URI, element.canonicalUri, element.canonicalUri); 287 Key.CANONICAL_URI, element.canonicalUri, element.canonicalUri);
288 encoder.setString(Key.LIBRARY_NAME, element.libraryName); 288 encoder.setString(Key.LIBRARY_NAME, element.libraryName);
289 SerializerUtil.serializeMembers(getMembers(element), encoder); 289 SerializerUtil.serializeMembers(getMembers(element), encoder);
290 encoder.setElement(Key.COMPILATION_UNIT, element.entryCompilationUnit); 290 encoder.setElement(Key.COMPILATION_UNIT, element.entryCompilationUnit);
291 encoder.setElements(Key.COMPILATION_UNITS, getCompilationUnits(element)); 291 encoder.setElements(Key.COMPILATION_UNITS, getCompilationUnits(element));
292 encoder.setElements(Key.IMPORTS, getImports(element)); 292 encoder.setElements(Key.IMPORTS, getImports(element));
293 encoder.setElements(Key.EXPORTS, element.exports); 293 encoder.setElements(Key.EXPORTS, element.exports);
294 294
295 encoder.setElements(Key.IMPORT_SCOPE, getImportedElements(element)); 295 encoder.setElements(Key.IMPORT_SCOPE, getImportedElements(element));
296
297 encoder.setElements(Key.EXPORT_SCOPE, getExportedElements(element)); 296 encoder.setElements(Key.EXPORT_SCOPE, getExportedElements(element));
298 } 297 }
299 } 298 }
300 299
301 class CompilationUnitSerializer implements ElementSerializer { 300 class CompilationUnitSerializer implements ElementSerializer {
302 const CompilationUnitSerializer(); 301 const CompilationUnitSerializer();
303 302
304 SerializedElementKind getSerializedKind(Element element) { 303 SerializedElementKind getSerializedKind(Element element) {
305 if (element.isCompilationUnit) { 304 if (element.isCompilationUnit) {
306 return SerializedElementKind.COMPILATION_UNIT; 305 return SerializedElementKind.COMPILATION_UNIT;
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 return new LocalVariableElementZ(decoder); 841 return new LocalVariableElementZ(decoder);
843 case SerializedElementKind.EXTERNAL_LIBRARY: 842 case SerializedElementKind.EXTERNAL_LIBRARY:
844 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER: 843 case SerializedElementKind.EXTERNAL_LIBRARY_MEMBER:
845 case SerializedElementKind.EXTERNAL_CLASS_MEMBER: 844 case SerializedElementKind.EXTERNAL_CLASS_MEMBER:
846 case SerializedElementKind.EXTERNAL_CONSTRUCTOR: 845 case SerializedElementKind.EXTERNAL_CONSTRUCTOR:
847 break; 846 break;
848 } 847 }
849 throw new UnsupportedError("Unexpected element kind '${elementKind}."); 848 throw new UnsupportedError("Unexpected element kind '${elementKind}.");
850 } 849 }
851 } 850 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dart2js.dart ('k') | tests/compiler/dart2js/constant_expression_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698