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

Unified Diff: lib/runtime/dart_runtime.js

Issue 1099703003: Treat our type objects as core.Type (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Updated CL Created 5 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 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: lib/runtime/dart_runtime.js
diff --git a/lib/runtime/dart_runtime.js b/lib/runtime/dart_runtime.js
index c9c21ea81135409a3a068380013d6b5474ec4d79..9dcae087dffbccf780269a907f3ec0af6796e51c 100644
--- a/lib/runtime/dart_runtime.js
+++ b/lib/runtime/dart_runtime.js
@@ -61,7 +61,7 @@ var dart, _js_helper, _js_primitives;
// Grab the `call` method if it's not a function.
if (f !== null) f = f.call;
if (!(f instanceof Function)) {
- throwNoSuchMethod(obj, method, args);
+ throwNoSuchMethod(obj, name, args);
}
}
// TODO(jmesserly): enable this when we can fix => and methods.
@@ -207,7 +207,15 @@ var dart, _js_helper, _js_primitives;
} else {
subtypeMap.set(t1, map = new Map());
}
- map.set(t2, result = isSubtype_(t1, t2));
+ if (t2 == core.Type) {
+ // Special case Types.
+ result = t1.prototype instanceof core.Type ||
+ t1 instanceof AbstractFunctionType ||
+ isSubtype_(t1, t2);
+ } else {
+ result = isSubtype_(t1, t2)
+ }
+ map.set(t2, result);
return result;
}
dart.isSubtype = isSubtype;
« 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