OLD | NEW |
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 summary_resynthesizer; | 5 library summary_resynthesizer; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
(...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1909 // Add the field. | 1909 // Add the field. |
1910 memberHolder.addField(field); | 1910 memberHolder.addField(field); |
1911 buildImplicitAccessors(field, memberHolder); | 1911 buildImplicitAccessors(field, memberHolder); |
1912 } | 1912 } |
1913 // Build the value of the 'values' field. | 1913 // Build the value of the 'values' field. |
1914 valuesField.evaluationResult = new EvaluationResultImpl( | 1914 valuesField.evaluationResult = new EvaluationResultImpl( |
1915 new DartObjectImpl(valuesField.type, new ListState(constantValues))); | 1915 new DartObjectImpl(valuesField.type, new ListState(constantValues))); |
1916 // done | 1916 // done |
1917 classElement.fields = memberHolder.fields; | 1917 classElement.fields = memberHolder.fields; |
1918 classElement.accessors = memberHolder.accessors; | 1918 classElement.accessors = memberHolder.accessors; |
1919 classElement.constructors = <ConstructorElement>[]; | |
1920 unitHolder.addEnum(classElement); | 1919 unitHolder.addEnum(classElement); |
1921 } | 1920 } |
1922 | 1921 |
1923 /** | 1922 /** |
1924 * Resynthesize an [ExecutableElement] and place it in the given [holder]. | 1923 * Resynthesize an [ExecutableElement] and place it in the given [holder]. |
1925 */ | 1924 */ |
1926 void buildExecutable( | 1925 void buildExecutable( |
1927 UnlinkedExecutable serializedExecutable, ElementImpl enclosingElement, | 1926 UnlinkedExecutable serializedExecutable, ElementImpl enclosingElement, |
1928 [ElementHolder holder]) { | 1927 [ElementHolder holder]) { |
1929 bool isTopLevel = holder == null; | 1928 bool isTopLevel = holder == null; |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2400 static String _getElementIdentifier(String name, ReferenceKind kind) { | 2399 static String _getElementIdentifier(String name, ReferenceKind kind) { |
2401 if (kind == ReferenceKind.topLevelPropertyAccessor || | 2400 if (kind == ReferenceKind.topLevelPropertyAccessor || |
2402 kind == ReferenceKind.propertyAccessor) { | 2401 kind == ReferenceKind.propertyAccessor) { |
2403 if (!name.endsWith('=')) { | 2402 if (!name.endsWith('=')) { |
2404 return name + '?'; | 2403 return name + '?'; |
2405 } | 2404 } |
2406 } | 2405 } |
2407 return name; | 2406 return name; |
2408 } | 2407 } |
2409 } | 2408 } |
OLD | NEW |