On 2013-03-23 17:14:21, Konstantin Tcholokachvili wrote: > You are right, I forgot about $exports. > But I would like to know how nekovm knows that foo is member of proto and not > a > casual function?
>From the language's point of view there is no difference between fields inherited from prototype and "regular" ones. It works similarity to Javascript, quoting the documentation: When a field is accessed for reading and is not found in an object, it is searched in its prototype, and like this recursively. And of course calling o.foo() is accessing field o.foo for reading. If object o in the example code had field o.foo itself, that one would be used instead of the one from the prototype. Neko tries to use function from the prototype exactly because o.foo otherwise does not exist. K. -- Neko : One VM to run them all (http://nekovm.org)
