On Mon, Oct 3, 2011 at 14:50, Axel Rauschmayer <[email protected]> wrote:
> It’s a performance thing support for dynamic "super" would slow everything
> down and is thus not worth it. In the current spec, there is a method for
> moving methods with "super" from one object to another. It’s not as elegant,
> but given the performance cost of dynamic "super", it’s the right call.
I'm not sure it is just a performance issue. I believe the semantics
is wrong too.
class B {
a() {
this.b();
}
b() {
print('B.b');
}
}
class C extends B {
a() {
super.a();
}
b() {
print('C.b');
}
}
var c = new C;
c.a(); // Should print 'C.b'
With a dynamic super the above would lookup b in the wrong object
(B.prototype instead of C.prototype).
--
erik
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss