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

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

Issue 1118963003: Fix for computing IS_CLIENT. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/dart.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.context.context; 5 library analyzer.src.context.context;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/src/cancelable_future.dart'; 10 import 'package:analyzer/src/cancelable_future.dart';
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 252 }
253 253
254 @override 254 @override
255 List<Source> get htmlSources => _getSources(SourceKind.HTML); 255 List<Source> get htmlSources => _getSources(SourceKind.HTML);
256 256
257 @override 257 @override
258 bool get isDisposed => _disposed; 258 bool get isDisposed => _disposed;
259 259
260 @override 260 @override
261 List<Source> get launchableClientLibrarySources { 261 List<Source> get launchableClientLibrarySources {
262 // TODO(brianwilkerson) This needs to filter out libraries that do not
263 // reference dart:html, either directly or indirectly.
264 List<Source> sources = new List<Source>(); 262 List<Source> sources = new List<Source>();
265 MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator(); 263 MapIterator<AnalysisTarget, cache.CacheEntry> iterator = _cache.iterator();
266 while (iterator.moveNext()) { 264 while (iterator.moveNext()) {
267 AnalysisTarget target = iterator.key; 265 AnalysisTarget target = iterator.key;
268 cache.CacheEntry entry = iterator.value; 266 cache.CacheEntry entry = iterator.value;
269 if (target is Source && 267 if (target is Source &&
270 entry.getValue(SOURCE_KIND) == SourceKind.LIBRARY && 268 entry.getValue(SOURCE_KIND) == SourceKind.LIBRARY &&
271 !target.isInSystemLibrary) { 269 !target.isInSystemLibrary &&
272 // DartEntry dartEntry = (DartEntry) sourceEntry; 270 isClientLibrary(target)) {
273 // if (dartEntry.getValue(DartEntry.IS_LAUNCHABLE) && !dartEntry.getVal ue(DartEntry.IS_CLIENT)) {
274 sources.add(target); 271 sources.add(target);
275 // }
276 } 272 }
277 } 273 }
278 return sources; 274 return sources;
279 } 275 }
280 276
281 @override 277 @override
282 List<Source> get launchableServerLibrarySources { 278 List<Source> get launchableServerLibrarySources {
283 // TODO(brianwilkerson) This needs to filter out libraries that reference 279 // TODO(brianwilkerson) This needs to filter out libraries that reference
284 // dart:html, either directly or indirectly. 280 // dart:html, either directly or indirectly.
285 List<Source> sources = new List<Source>(); 281 List<Source> sources = new List<Source>();
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 557
562 @override 558 @override
563 List<Source> computeExportedLibraries(Source source) => 559 List<Source> computeExportedLibraries(Source source) =>
564 _computeResult(source, EXPORTED_LIBRARIES); 560 _computeResult(source, EXPORTED_LIBRARIES);
565 561
566 @override 562 @override
567 // TODO(brianwilkerson) Implement this. 563 // TODO(brianwilkerson) Implement this.
568 HtmlElement computeHtmlElement(Source source) => null; 564 HtmlElement computeHtmlElement(Source source) => null;
569 565
570 @override 566 @override
571 List<Source> computeImportedLibraries(Source source) => _computeResult( 567 List<Source> computeImportedLibraries(Source source) =>
572 source, IMPORTED_LIBRARIES); 568 _computeResult(source, IMPORTED_LIBRARIES);
573 569
574 @override 570 @override
575 SourceKind computeKindOf(Source source) => 571 SourceKind computeKindOf(Source source) =>
576 _computeResult(source, SOURCE_KIND); 572 _computeResult(source, SOURCE_KIND);
577 573
578 @override 574 @override
579 LibraryElement computeLibraryElement(Source source) => 575 LibraryElement computeLibraryElement(Source source) => _computeResult(
580 _computeResult(source, LIBRARY_ELEMENT); //_computeResult(source, HtmlEntr y.ELEMENT); 576 source, LIBRARY_ELEMENT); //_computeResult(source, HtmlEntry.ELEMENT);
581 577
582 @override 578 @override
583 LineInfo computeLineInfo(Source source) => _computeResult(source, LINE_INFO); 579 LineInfo computeLineInfo(Source source) => _computeResult(source, LINE_INFO);
584 580
585 @override 581 @override
586 @deprecated 582 @deprecated
587 CompilationUnit computeResolvableCompilationUnit(Source source) { 583 CompilationUnit computeResolvableCompilationUnit(Source source) {
588 return null; 584 return null;
589 } 585 }
590 586
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1977 // Check cache for an existing partition. 1973 // Check cache for an existing partition.
1978 cache.SdkCachePartition partition = _sdkPartitions[sdk]; 1974 cache.SdkCachePartition partition = _sdkPartitions[sdk];
1979 if (partition == null) { 1975 if (partition == null) {
1980 partition = 1976 partition =
1981 new cache.SdkCachePartition(sdkContext, _DEFAULT_SDK_CACHE_SIZE); 1977 new cache.SdkCachePartition(sdkContext, _DEFAULT_SDK_CACHE_SIZE);
1982 _sdkPartitions[sdk] = partition; 1978 _sdkPartitions[sdk] = partition;
1983 } 1979 }
1984 return partition; 1980 return partition;
1985 } 1981 }
1986 } 1982 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698