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

Unified Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 792093002: Fix sort order in engine.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/engine.dart
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 9d50042f4bbe6748d89f6d4fc473b4cb5137ebe2..b63fb1f69cdcfaaa4b2be1bbdbefe282fb153a3f 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -1137,26 +1137,6 @@ class AnalysisContextImpl implements InternalAnalysisContext {
return sources;
}
- Element findElementById(int id) {
- _ElementByIdFinder finder = new _ElementByIdFinder(id);
- try {
- MapIterator<Source, SourceEntry> iterator = _cache.iterator();
- while (iterator.moveNext()) {
- SourceEntry sourceEntry = iterator.value;
- if (sourceEntry.kind == SourceKind.LIBRARY) {
- DartEntry dartEntry = sourceEntry;
- LibraryElement library = dartEntry.getValue(DartEntry.ELEMENT);
- if (library != null) {
- library.accept(finder);
- }
- }
- }
- } on _ElementByIdFinderException catch (e) {
- return finder.result;
- }
- return null;
- }
-
@override
List<Source> get librarySources => _getSources(SourceKind.LIBRARY);
@@ -1699,6 +1679,26 @@ class AnalysisContextImpl implements InternalAnalysisContext {
return source.exists();
}
+ Element findElementById(int id) {
+ _ElementByIdFinder finder = new _ElementByIdFinder(id);
+ try {
+ MapIterator<Source, SourceEntry> iterator = _cache.iterator();
+ while (iterator.moveNext()) {
+ SourceEntry sourceEntry = iterator.value;
+ if (sourceEntry.kind == SourceKind.LIBRARY) {
+ DartEntry dartEntry = sourceEntry;
+ LibraryElement library = dartEntry.getValue(DartEntry.ELEMENT);
+ if (library != null) {
+ library.accept(finder);
+ }
+ }
+ }
+ } on _ElementByIdFinderException catch (e) {
+ return finder.result;
+ }
+ return null;
+ }
+
@override
AngularApplication getAngularApplicationWithHtml(Source htmlSource) {
SourceEntry sourceEntry = getReadableSourceEntryOrNull(htmlSource);
@@ -5033,25 +5033,6 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
}
-class _ElementByIdFinder extends GeneralizingElementVisitor {
- final int _id;
- Element result;
-
- _ElementByIdFinder(this._id);
-
- @override
- visitElement(Element element) {
- if (element.id == _id) {
- result = element;
- throw new _ElementByIdFinderException();
- }
- super.visitElement(element);
- }
-}
-
-class _ElementByIdFinderException {
-}
-
/**
* An `AnalysisTaskResultRecorder` is used by an analysis context to record the
* results of a task.
@@ -9488,7 +9469,6 @@ class DartEntry extends SourceEntry {
}
}
-
/**
* Instances of the class `DataDescriptor` are immutable constants representing data that can
* be stored in the cache.
@@ -9549,6 +9529,7 @@ class DefaultRetentionPolicy implements CacheRetentionPolicy {
}
}
+
/**
* Recursively visits [HtmlUnit] and every embedded [Expression].
*/
@@ -14967,6 +14948,25 @@ class _AngularHtmlUnitResolver_visitModelDirectives extends
}
}
+class _ElementByIdFinder extends GeneralizingElementVisitor {
+ final int _id;
+ Element result;
+
+ _ElementByIdFinder(this._id);
+
+ @override
+ visitElement(Element element) {
+ if (element.id == _id) {
+ result = element;
+ throw new _ElementByIdFinderException();
+ }
+ super.visitElement(element);
+ }
+}
+
+class _ElementByIdFinderException {
+}
+
class _PolymerHtmlUnitBuilder_findTagDartElement extends
RecursiveElementVisitor<Object> {
final PolymerHtmlUnitBuilder PolymerHtmlUnitBuilder_this;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698