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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/CoreTypeProviderImplementation.java

Issue 8894031: Use VM specific types if DartC types are not available (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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: compiler/java/com/google/dart/compiler/resolver/CoreTypeProviderImplementation.java
===================================================================
--- compiler/java/com/google/dart/compiler/resolver/CoreTypeProviderImplementation.java (revision 2324)
+++ compiler/java/com/google/dart/compiler/resolver/CoreTypeProviderImplementation.java (working copy)
@@ -49,10 +49,10 @@
this.fallThroughError = getType("FallThroughError", scope, listener);
this.mapType = getType("Map", scope, listener);
this.mapLiteralType = getType("LinkedHashMapImplementation", scope, listener);
- this.objectArrayType = getType("ListImplementation", scope, listener);
+ this.objectArrayType = getType(new String[] {"ListImplementation", "GrowableObjectArray"}, scope, listener);
this.objectType = getType("Object", scope, listener);
this.isolateType = getType("Isolate", scope, listener);
- this.stringImplementation = getType("StringImplementation", scope, listener);
+ this.stringImplementation = getType(new String[] {"StringImplementation", "OneByteString"}, scope, listener);
iteratorType = getType("Iterator", scope, listener);
}
@@ -68,6 +68,23 @@
return element.getType();
}
+ private static InterfaceType getType(String[] names, Scope scope, DartCompilerListener listener) {
+ ClassElement element = null;
+ for (String name : names) {
+ element = (ClassElement) scope.findElement(scope.getLibrary(), name);
+ if (element != null)
+ break;
+ }
+ if (element == null) {
+ DartCompilationError error =
+ new DartCompilationError(null, Location.NONE,
+ ResolverErrorCode.CANNOT_BE_RESOLVED, names[0]);
+ listener.onError(error);
+ return Types.newDynamicType();
+ }
+ return element.getType();
+ }
+
@Override
public InterfaceType getIntType() {
return intType;
« 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