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

Side by Side Diff: pkg/analyzer/lib/src/summary/summarize_elements.dart

Issue 1537223002: Clear 'referenceMap' before summarizing a new unit. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add a new test_all file. Created 5 years 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/analyzer/test/src/summary/summary_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 serialization.elements; 5 library serialization.elements;
6 6
7 import 'package:analyzer/dart/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 import 'package:analyzer/dart/element/type.dart'; 8 import 'package:analyzer/dart/element/type.dart';
9 import 'package:analyzer/src/dart/element/type.dart'; 9 import 'package:analyzer/src/dart/element/type.dart';
10 import 'package:analyzer/src/generated/resolver.dart'; 10 import 'package:analyzer/src/generated/resolver.dart';
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 LibraryElement get coreLibrary => typeProvider.objectType.element.library; 149 LibraryElement get coreLibrary => typeProvider.objectType.element.library;
150 150
151 /** 151 /**
152 * Add all classes, enums, typedefs, executables, and top level variables 152 * Add all classes, enums, typedefs, executables, and top level variables
153 * from the given compilation unit [element] to the library summary. 153 * from the given compilation unit [element] to the library summary.
154 * [unitNum] indicates the ordinal position of this compilation unit in the 154 * [unitNum] indicates the ordinal position of this compilation unit in the
155 * library. 155 * library.
156 */ 156 */
157 void addCompilationUnitElements(CompilationUnitElement element, int unitNum) { 157 void addCompilationUnitElements(CompilationUnitElement element, int unitNum) {
158 UnlinkedUnitBuilder b = new UnlinkedUnitBuilder(ctx); 158 UnlinkedUnitBuilder b = new UnlinkedUnitBuilder(ctx);
159 referenceMap.clear();
159 unlinkedReferences = <UnlinkedReferenceBuilder>[ 160 unlinkedReferences = <UnlinkedReferenceBuilder>[
160 encodeUnlinkedReference(ctx) 161 encodeUnlinkedReference(ctx)
161 ]; 162 ];
162 prelinkedReferences = <PrelinkedReferenceBuilder>[ 163 prelinkedReferences = <PrelinkedReferenceBuilder>[
163 encodePrelinkedReference(ctx, kind: PrelinkedReferenceKind.classOrEnum) 164 encodePrelinkedReference(ctx, kind: PrelinkedReferenceKind.classOrEnum)
164 ]; 165 ];
165 if (unitNum == 0) { 166 if (unitNum == 0) {
166 // TODO(paulberry): we need to figure out a way to record library, part, 167 // TODO(paulberry): we need to figure out a way to record library, part,
167 // import, and export declarations that appear in non-defining 168 // import, and export declarations that appear in non-defining
168 // compilation units (even though such declarations are prohibited by the 169 // compilation units (even though such declarations are prohibited by the
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 UnlinkedVariableBuilder b = new UnlinkedVariableBuilder(ctx); 605 UnlinkedVariableBuilder b = new UnlinkedVariableBuilder(ctx);
605 b.name = variable.name; 606 b.name = variable.name;
606 b.type = serializeTypeRef(variable.type, variable); 607 b.type = serializeTypeRef(variable.type, variable);
607 b.isStatic = variable.isStatic && variable.enclosingElement is ClassElement; 608 b.isStatic = variable.isStatic && variable.enclosingElement is ClassElement;
608 b.isFinal = variable.isFinal; 609 b.isFinal = variable.isFinal;
609 b.isConst = variable.isConst; 610 b.isConst = variable.isConst;
610 b.hasImplicitType = variable.hasImplicitType; 611 b.hasImplicitType = variable.hasImplicitType;
611 return b; 612 return b;
612 } 613 }
613 } 614 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/summary_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698