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

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

Issue 1013973003: Use PUBLIC_NAMESPACE for computing TypeProvider. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index eaa80a47742dac6bf2329a9f04b943d941abd7d3..7a6952e790e3a761b1db1b16abd61aa0f19d5050 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -3731,7 +3731,8 @@ class EnumMemberBuilder extends RecursiveAstVisitor<Object> {
indexField.type = intType;
fields.add(indexField);
getters.add(_createGetter(indexField));
- ConstFieldElementImpl valuesField = new ConstFieldElementImpl.con2("values", -1);
+ ConstFieldElementImpl valuesField =
+ new ConstFieldElementImpl.con2("values", -1);
valuesField.static = true;
valuesField.const3 = true;
valuesField.synthetic = true;
@@ -3768,7 +3769,8 @@ class EnumMemberBuilder extends RecursiveAstVisitor<Object> {
//
// Build the value of the 'values' field.
//
- valuesField.evaluationResult = new EvaluationResultImpl.con1(new DartObjectImpl(valuesField.type, new ListState(constantValues)));
+ valuesField.evaluationResult = new EvaluationResultImpl.con1(
+ new DartObjectImpl(valuesField.type, new ListState(constantValues)));
//
// Finish building the enum.
//
@@ -13396,12 +13398,24 @@ class TypeProviderImpl implements TypeProvider {
DartType _undefinedType;
/**
- * Initialize a newly created type provider to provide the types defined in the given library.
- *
- * @param coreLibrary the element representing the core library (dart:core).
+ * Initialize a newly created type provider to provide the types defined in
+ * the given [coreLibrary] and [asyncLibrary].
*/
TypeProviderImpl(LibraryElement coreLibrary, LibraryElement asyncLibrary) {
- _initializeFrom(coreLibrary, asyncLibrary);
+ Namespace coreNamespace =
+ new NamespaceBuilder().createPublicNamespaceForLibrary(coreLibrary);
+ Namespace asyncNamespace =
+ new NamespaceBuilder().createPublicNamespaceForLibrary(asyncLibrary);
+ _initializeFrom(coreNamespace, asyncNamespace);
+ }
+
+ /**
+ * Initialize a newly created type provider to provide the types defined in
+ * the given [Namespace]s.
+ */
+ TypeProviderImpl.forNamespaces(
+ Namespace coreNamespace, Namespace asyncNamespace) {
+ _initializeFrom(coreNamespace, asyncNamespace);
}
@override
@@ -13495,16 +13509,10 @@ class TypeProviderImpl implements TypeProvider {
}
/**
- * Initialize the types provided by this type provider from the given library.
- *
- * @param library the library containing the definitions of the core types
+ * Initialize the types provided by this type provider from the given
+ * [Namespace]s.
*/
- void _initializeFrom(
- LibraryElement coreLibrary, LibraryElement asyncLibrary) {
- Namespace coreNamespace =
- new NamespaceBuilder().createPublicNamespaceForLibrary(coreLibrary);
- Namespace asyncNamespace =
- new NamespaceBuilder().createPublicNamespaceForLibrary(asyncLibrary);
+ void _initializeFrom(Namespace coreNamespace, Namespace asyncNamespace) {
_boolType = _getType(coreNamespace, "bool");
_bottomType = BottomTypeImpl.instance;
_deprecatedType = _getType(coreNamespace, "Deprecated");
« 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