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

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

Issue 1906543002: Remove a couple of unnecessary is checks (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « pkg/analyzer/lib/instrumentation/instrumentation.dart ('k') | no next file » | 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/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 return true; 802 return true;
803 } 803 }
804 return source.exists(); 804 return source.exists();
805 } 805 }
806 806
807 @override 807 @override
808 CacheEntry getCacheEntry(AnalysisTarget target) { 808 CacheEntry getCacheEntry(AnalysisTarget target) {
809 CacheEntry entry = _cache.get(target); 809 CacheEntry entry = _cache.get(target);
810 if (entry == null) { 810 if (entry == null) {
811 entry = new CacheEntry(target); 811 entry = new CacheEntry(target);
812 ImplicitAnalysisEvent event = null;
812 if (target is Source) { 813 if (target is Source) {
813 entry.modificationTime = getModificationStamp(target); 814 entry.modificationTime = getModificationStamp(target);
815 event = new ImplicitAnalysisEvent(target, true);
814 } 816 }
815 _cache.put(entry); 817 _cache.put(entry);
816 if (target is Source) { 818 if (event != null) {
817 _implicitAnalysisEventsController 819 _implicitAnalysisEventsController.add(event);
818 .add(new ImplicitAnalysisEvent(target, true));
819 } 820 }
820 } 821 }
821 return entry; 822 return entry;
822 } 823 }
823 824
824 @override 825 @override
825 CompilationUnitElement getCompilationUnitElement( 826 CompilationUnitElement getCompilationUnitElement(
826 Source unitSource, Source librarySource) { 827 Source unitSource, Source librarySource) {
827 AnalysisTarget target = new LibrarySpecificUnit(librarySource, unitSource); 828 AnalysisTarget target = new LibrarySpecificUnit(librarySource, unitSource);
828 return getResult(target, COMPILATION_UNIT_ELEMENT); 829 return getResult(target, COMPILATION_UNIT_ELEMENT);
(...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
2195 } 2196 }
2196 DartSdk sdk = factory.dartSdk; 2197 DartSdk sdk = factory.dartSdk;
2197 if (sdk == null) { 2198 if (sdk == null) {
2198 throw new IllegalArgumentException( 2199 throw new IllegalArgumentException(
2199 "The source factory for an SDK analysis context must have a DartUriRes olver"); 2200 "The source factory for an SDK analysis context must have a DartUriRes olver");
2200 } 2201 }
2201 return new AnalysisCache( 2202 return new AnalysisCache(
2202 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); 2203 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]);
2203 } 2204 }
2204 } 2205 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/instrumentation/instrumentation.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698