feat: add class name storage and expose via name method on class objects

Store the class name string in `ObjClass` during compilation and class creation, and expose it through a new `class_name` native method. Also update `object_toString` to return the class name for class instances and "instance of <name>" for regular instances.
This commit is contained in:
Bob Nystrom
2014-01-28 23:31:11 +00:00
parent 74b67eae67
commit e83296ea53
9 changed files with 182 additions and 83 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
class Foo {}
IO.print((new Foo).toString) // expect: <object>
IO.print((new Foo).toString == "instance of Foo") // expect: true