R
Richard Trahan
In the 1.5 Guide, Chapter 8 (Details of the Object Model), last
sentence: "The dennis object does not inherit this new property".
I don't understand why this is so. A few pages earlier, it says "If you
want to change the value of an object property at run time and have the
new value be inherited by all descendants of the object, you cannot
define the property in the object's contructor function. Instead, you
add it to the constructor's associated prototype." This is followed by
an example.
The 'dennis' example is different in that the property added to the
prototype is not a changed value, but a new property. I understand that
new properties can be added at runtime simply by adding them to the
constructor object, but the rules aren't clear regarding how the system
treats adding a brand new property to the constructor object's prototype
property at run time.
Can anyone clarify this for me, please.
sentence: "The dennis object does not inherit this new property".
I don't understand why this is so. A few pages earlier, it says "If you
want to change the value of an object property at run time and have the
new value be inherited by all descendants of the object, you cannot
define the property in the object's contructor function. Instead, you
add it to the constructor's associated prototype." This is followed by
an example.
The 'dennis' example is different in that the property added to the
prototype is not a changed value, but a new property. I understand that
new properties can be added at runtime simply by adding them to the
constructor object, but the rules aren't clear regarding how the system
treats adding a brand new property to the constructor object's prototype
property at run time.
Can anyone clarify this for me, please.