QuickBEAM.VM.ObjectModel.Class (QuickBEAM v0.10.9)

Copy Markdown View Source

Class runtime support: super resolution, constructor dispatch, and extends prototype wiring.

Summary

Functions

Classifies an explicit constructor return value according to JavaScript class semantics.

Applies JavaScript constructor return rules by keeping object-like returns and otherwise preserving this.

Defines an unnamed class with a constructor name resolved from the atom table.

Returns the superclass/prototype target associated with a class, method, or constructor value.

Reads a property through the super lookup path using this as the getter receiver.

Writes a property through the super lookup path using this as the setter receiver.

Extracts the underlying VM function from closure values.

Functions

check_ctor_return(val)

Classifies an explicit constructor return value according to JavaScript class semantics.

coalesce_this_result(result, this_obj)

Applies JavaScript constructor return rules by keeping object-like returns and otherwise preserving this.

define_class(ctor_closure, parent_ctor, class_name \\ nil)

define_class_name(ctor_closure, atom_idx, atoms \\ Heap.get_atoms())

Defines an unnamed class with a constructor name resolved from the atom table.

get_super(func)

Returns the superclass/prototype target associated with a class, method, or constructor value.

get_super_value(proto_obj, this_obj, key)

Reads a property through the super lookup path using this as the getter receiver.

put_super_value(proto_obj, this_obj, key, val)

Writes a property through the super lookup path using this as the setter receiver.

raw_function(fun)

Extracts the underlying VM function from closure values.