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

Unified Diff: runtime/lib/mirrors.cc

Issue 25674017: Fix runtimeType for strings, integers and double: return their interface type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | « runtime/lib/integers.dart ('k') | runtime/lib/mirrors_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
===================================================================
--- runtime/lib/mirrors.cc (revision 28266)
+++ runtime/lib/mirrors.cc (working copy)
@@ -1148,6 +1148,24 @@
}
+DEFINE_NATIVE_ENTRY(InstanceMirror_computeType, 1) {
+ GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance, arguments->NativeArgAt(0));
+ if (instance.IsString()) {
rmacnak 2013/10/04 21:21:22 We are not required to hide these implementation t
+ return Type::StringType();
+ }
+ if (instance.IsInteger()) {
+ return Type::IntType();
+ }
+ if (instance.IsDouble()) {
+ return Type::Double();
+ }
+ const Type& type = Type::Handle(instance.GetType());
+ // The static type of null is specified to be the bottom type, however, the
+ // runtime type of null is the Null type, which we correctly return here.
+ return type.Canonicalize();
+}
+
+
DEFINE_NATIVE_ENTRY(ClosureMirror_apply, 3) {
GET_NON_NULL_NATIVE_ARGUMENT(Instance, closure, arguments->NativeArgAt(0));
ASSERT(!closure.IsNull() && closure.IsCallable(NULL, NULL));
« no previous file with comments | « runtime/lib/integers.dart ('k') | runtime/lib/mirrors_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698