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

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

Issue 1180673008: Create LibraryElement with SDK context for SDK sources. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rollback model.dart change. Created 5 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/task/dart_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 import 'dart:math' as math; 8 import 'dart:math' as math;
9 9
10 import 'package:analyzer/src/context/cache.dart'; 10 import 'package:analyzer/src/context/cache.dart';
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 ..setProperty(ErrorProperty.PARTS_LIBRARY_NAME, partsLibraryName); 1413 ..setProperty(ErrorProperty.PARTS_LIBRARY_NAME, partsLibraryName);
1414 } else { 1414 } else {
1415 error = new AnalysisError(librarySource, 0, 0, 1415 error = new AnalysisError(librarySource, 0, 0,
1416 ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART); 1416 ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART);
1417 } 1417 }
1418 errors.add(error); 1418 errors.add(error);
1419 } 1419 }
1420 // 1420 //
1421 // Create and populate the library element. 1421 // Create and populate the library element.
1422 // 1422 //
1423 AnalysisContext owningContext = context;
1424 if (context is InternalAnalysisContext) {
1425 InternalAnalysisContext internalContext = context;
1426 owningContext = internalContext.getContextFor(librarySource);
1427 }
1423 LibraryElementImpl libraryElement = 1428 LibraryElementImpl libraryElement =
1424 new LibraryElementImpl.forNode(context, libraryNameNode); 1429 new LibraryElementImpl.forNode(owningContext, libraryNameNode);
1425 libraryElement.definingCompilationUnit = definingCompilationUnitElement; 1430 libraryElement.definingCompilationUnit = definingCompilationUnitElement;
1426 libraryElement.entryPoint = entryPoint; 1431 libraryElement.entryPoint = entryPoint;
1427 libraryElement.parts = sourcedCompilationUnits; 1432 libraryElement.parts = sourcedCompilationUnits;
1428 for (Directive directive in directivesToResolve) { 1433 for (Directive directive in directivesToResolve) {
1429 directive.element = libraryElement; 1434 directive.element = libraryElement;
1430 } 1435 }
1431 if (sourcedCompilationUnits.isNotEmpty) { 1436 if (sourcedCompilationUnits.isNotEmpty) {
1432 _patchTopLevelAccessors(libraryElement); 1437 _patchTopLevelAccessors(libraryElement);
1433 } 1438 }
1434 // 1439 //
(...skipping 2086 matching lines...) Expand 10 before | Expand all | Expand 10 after
3521 @override 3526 @override
3522 bool moveNext() { 3527 bool moveNext() {
3523 if (_newSources.isEmpty) { 3528 if (_newSources.isEmpty) {
3524 return false; 3529 return false;
3525 } 3530 }
3526 currentTarget = _newSources.first; 3531 currentTarget = _newSources.first;
3527 _newSources.remove(currentTarget); 3532 _newSources.remove(currentTarget);
3528 return true; 3533 return true;
3529 } 3534 }
3530 } 3535 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698