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

Unified Diff: runtime/lib/object.cc

Issue 10979058: - Implement first class types in the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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/lib_sources.gypi ('k') | runtime/lib/object_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/object.cc
===================================================================
--- runtime/lib/object.cc (revision 12980)
+++ runtime/lib/object.cc (working copy)
@@ -55,4 +55,17 @@
return Object::null();
}
+
+DEFINE_NATIVE_ENTRY(Object_runtimeType, 1) {
+ const Instance& instance = Instance::CheckedHandle(arguments->At(0));
+ const Type& type = Type::Handle(instance.GetType());
+ return type.Canonicalize();
+}
+
+
+DEFINE_NATIVE_ENTRY(AbstractType_toString, 1) {
+ const AbstractType& type = AbstractType::CheckedHandle(arguments->At(0));
+ return type.Name();
regis 2012/09/27 21:12:40 You may consider returning UserVisibleName() inste
Ivan Posva 2012/09/27 21:25:12 I specifically chose Name and not UserVisibleName
+}
+
} // namespace dart
« no previous file with comments | « runtime/lib/lib_sources.gypi ('k') | runtime/lib/object_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698