P
petermichaux
Hi,
A discussion on the YUI page is depending on some speculation and I
know someone here knows the truth. Below is the relevant section. If
you can clarify this confusion I would greatly appreciate it.
Thanks,
Peter
I responded:
I don't think this is the way it works. I think that if the object
doesn't contain the method then the next place the compiler looks is
in the prototype for the objects class. If it works like you suggested
then if you create an inheritance chain the object would need method
references for all methods in the inheritance chain. I don't think the
guys writing compilers want to work that hard.
A discussion on the YUI page is depending on some speculation and I
know someone here knows the truth. Below is the relevant section. If
you can clarify this confusion I would greatly appreciate it.
Thanks,
Peter
One said:I'm not entirely sure how browsers handle prototypes, but I strongly
suspect that any item that makes use of a prototype contains
references (function pointers) to the prototype code, and that
overloading is performed simply by overwriting these references.
I responded:
I don't think this is the way it works. I think that if the object
doesn't contain the method then the next place the compiler looks is
in the prototype for the objects class. If it works like you suggested
then if you create an inheritance chain the object would need method
references for all methods in the inheritance chain. I don't think the
guys writing compilers want to work that hard.