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:
@@ -1,2 +1,2 @@
|
||||
class Foo {}
|
||||
IO.print((new Foo).toString) // expect: <object>
|
||||
IO.print((new Foo).toString == "instance of Foo") // expect: true
|
||||
|
||||
Reference in New Issue
Block a user