It seems to me that transfering bound methods to the function instances
makes the situation equally confusing:
Now if write:
class C { var x : String; function m() : String { return this.x }}
c = new C;
function F() {}
F.prototype=c;
f = new F; // f.__proto__ = c
f.x =4;
f.m() -> ???
A Transferred bound method would mean that when we call f.m(), that the
"this" in the method execution is actually c and not f. Does that really
make sense?
Kris



But it could be allowed, just as the following is allowed when a method m
is added to the class C defined above,

> var o = {}
> o.g = F.prototype.m
> o.g ()

'this' is bound to 'c' in 'g'.

_______________________________________________
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss

Reply via email to