refactor: split class creation into raw single-class and superclass binding phases
The bootstrapping of Object and Class now uses a two-phase approach: first creating a raw class with no metaclass or superclass via wrenNewSingleClass, then explicitly wiring superclass relationships with wrenBindSuperclass. This eliminates the need for special-case handling of null superclasses in the old newClass function and makes the metaclass chain setup explicit in wrenInitializeCore.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
class Foo {}
|
||||
|
||||
// A class is a class.
|
||||
IO.write(Foo is Class) // expect: true
|
||||
|
||||
// It's metatype is also a class.
|
||||
IO.write(Foo.type is Class) // expect: true
|
||||
|
||||
// The metatype's metatype is Class.
|
||||
IO.write(Foo.type.type == Class) // expect: true
|
||||
Reference in New Issue
Block a user