in other words, when u do
a.say :=
- a is checked to see what kinds of properties of the same name it contains(if any at all)
- a.Base is checked to see what kinds of properties of the same name it contains(if any at all)
- a.Base.Base is then checked
- a.Base.Base.Base next
- and so on and so forth
then whichever case happens first:
- if u found a read-only property(those are properties for which calling .GetOwnPropDesc() on would return an object containing no .Set or .Value properties), an exception is thrown saying u cant overwrite it
- if u found a property with a setter, invoke the setter
- if u found a value-property in a, overwrite it
- if u ran out of bases to go through or u found a value-property in any of a's bases, create the value-property "say" in a, and assign to it whatever u wanted to assign to it
the "merging" was only relevant for the removal of
.GetMethod(),
.OwnMethods() and such like. properties are distinct from methods.
u can have this kind of object that defines a read-only property:
Code: Select all
class s {
say => (this) => MsgBox("tikki spots on!")
}
or u can have this kind of object that defines a method:
Code: Select all
class s {
say() => MsgBox("tikki spots on!")
}
or u can even have this kind of object that defines a value-property:
Code: Select all
class s {
}
s.Prototype.DefineProp('say', {value: (this) => MsgBox("tikki spots on!")})
and while to an observer it might seem like theyre all methods:
u can clearly tell that theyre all different. and not only that, they can coexist:
While a property definition defines the get and set accessor functions for a property in the same way as DefineProp, a method definition defines the call accessor function. Any class may contain a property definition and a method definition with the same name. If a property without a call accessor function (a method) is called, get is invoked with no parameters and the result is then called as a method.