@ManuH DOTCALL simulates invoking a method on an object. For example:
person.speak(); //invokes the speak method, which may exist anywhere on the prototype, but uses “person” as “this”.
DOTCALL(person, ‘speak’); //will do the same as above
DOT = function(obj, prop) { if (obj.hasOwnProperty(prop)) { return obj[prop]; } else { var parent = obj.__proto__; if(parent.hasOwnProperty(prop){ return parent[prop]; } } }
DOT = function(obj, prop) { if (obj.hasOwnProperty(prop)) { return obj[prop]; } else { return DOT(obj.__proto__, prop); } };