i'm trying to figure out how much i can use of the javascript language itself and how much i would have to implement myself when it comes to object reflection. here's the intended result
// property inheritance schema (defining default props) (stored in db "schemas" table)
foo
bar
moo
baz
ugh
// method inheritance schema (stored in code)
foo
bar
moo
baz
ugh
// myTree structure + property overrides (stored in db "structs" table)
myBar
myBaz
myUgh
myBar
myBaz
myMoo
an instance of a Tree object will be constructed from the myBar structure. when building each node, it will compose the methods from the code, with the "inherited" property schema and any non-default properties from the node defined in the myBar struct itself.
the goal is to create a a system that, given a node from an instance of Tree, can self-analyze its own property inheritance path and identify at which level the property is defined.
this is to allow editing of the myBar structure and indicate which properties are inherited as defaults from the base schema (and at which level) and which ones are explicitly defined in the myBar structure.
the question is, how much can be determined from recursively analyzing the .constructor and .prototype properties using JS, and how much would need to be custom implemented?
i'm not sure if this is sufficiently clear, so please ask for any clarification.
thanks!