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

Side by Side Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 2092673002: Fix recomputing LibraryElement.exportNamespace. (Closed) Base URL: git@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/analyzer/test/src/context/context_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 analyzer.src.task.dart; 5 library analyzer.src.task.dart;
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 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 1377
1378 @override 1378 @override
1379 TaskDescriptor get descriptor => DESCRIPTOR; 1379 TaskDescriptor get descriptor => DESCRIPTOR;
1380 1380
1381 @override 1381 @override
1382 void internalPerform() { 1382 void internalPerform() {
1383 LibraryElementImpl library = getRequiredInput(LIBRARY_INPUT); 1383 LibraryElementImpl library = getRequiredInput(LIBRARY_INPUT);
1384 // 1384 //
1385 // Compute export namespace. 1385 // Compute export namespace.
1386 // 1386 //
1387 library.exportNamespace = null;
1387 NamespaceBuilder builder = new NamespaceBuilder(); 1388 NamespaceBuilder builder = new NamespaceBuilder();
1388 Namespace namespace = builder.createExportNamespaceForLibrary(library); 1389 Namespace namespace = builder.createExportNamespaceForLibrary(library);
1389 library.exportNamespace = namespace; 1390 library.exportNamespace = namespace;
1390 // 1391 //
1391 // Update entry point. 1392 // Update entry point.
1392 // 1393 //
1393 if (library.entryPoint == null) { 1394 if (library.entryPoint == null) {
1394 Iterable<Element> exportedElements = namespace.definedNames.values; 1395 Iterable<Element> exportedElements = namespace.definedNames.values;
1395 library.entryPoint = exportedElements.firstWhere( 1396 library.entryPoint = exportedElements.firstWhere(
1396 (element) => element is FunctionElement && element.isEntryPoint, 1397 (element) => element is FunctionElement && element.isEntryPoint,
(...skipping 4830 matching lines...) Expand 10 before | Expand all | Expand 10 after
6227 6228
6228 @override 6229 @override
6229 bool moveNext() { 6230 bool moveNext() {
6230 if (_newSources.isEmpty) { 6231 if (_newSources.isEmpty) {
6231 return false; 6232 return false;
6232 } 6233 }
6233 currentTarget = _newSources.removeLast(); 6234 currentTarget = _newSources.removeLast();
6234 return true; 6235 return true;
6235 } 6236 }
6236 } 6237 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698