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

Unified Diff: pkg/analyzer/lib/src/summary/resynthesize.dart

Issue 2029053002: A different approach for resynthesizing enumerations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/resynthesize.dart
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index 034aa0b782803e9ccbae76c0b2598d76cdb5a9e7..52e5e8d8542da2c99b84ffbf5de038fc4464e002 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -1677,18 +1677,6 @@ class _UnitResynthesizer {
}
/**
- * Build the annotations for the given [element].
- */
- void buildAnnotations(
- ElementImpl element, List<UnlinkedConst> serializedAnnotations) {
- if (serializedAnnotations.isNotEmpty) {
- element.metadata = serializedAnnotations
- .map((a) => buildAnnotation(element, a))
- .toList();
- }
- }
-
- /**
* Resynthesize a [ClassElement] and place it in [unitHolder].
*/
void buildClass(UnlinkedClass serializedClass) {
@@ -1757,7 +1745,7 @@ class _UnitResynthesizer {
ClassElementImpl buildClassImpl(
UnlinkedClass serializedClass, ClassElementHandle handle) {
ClassElementImpl classElement =
- new ClassElementImpl.forSerialized(serializedClass, unit);
+ new ClassElementImpl.forSerialized(serializedClass, null, unit);
classElement.hasBeenInferred = summaryResynthesizer.strongMode;
InterfaceTypeImpl correspondingType =
new InterfaceTypeImpl(handle ?? classElement);
@@ -1891,14 +1879,10 @@ class _UnitResynthesizer {
void buildEnum(UnlinkedEnum serializedEnum) {
assert(!libraryResynthesizer.isCoreLibrary);
ClassElementImpl classElement =
- new ClassElementImpl(serializedEnum.name, serializedEnum.nameOffset);
- classElement.enum2 = true;
+ new ClassElementImpl.forSerialized(null, serializedEnum, unit);
InterfaceType enumType = new InterfaceTypeImpl(classElement);
classElement.type = enumType;
classElement.supertype = typeProvider.objectType;
- buildDocumentation(classElement, serializedEnum.documentationComment);
- buildAnnotations(classElement, serializedEnum.annotations);
- buildCodeRange(classElement, serializedEnum.codeRange);
ElementHolder memberHolder = new ElementHolder();
// Build the 'index' field.
FieldElementImpl indexField = new FieldElementImpl('index', -1);
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698