The specification mentions that the following function will be used for extension :
var __extends = this.__extends || function(d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function f() { this.constructor = d; }
f.prototype = b.prototype;
d.prototype = new f();
}
However the function generated currently is :
var __extends = this.__extends || function (d, b) {
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
This breaks static inheritance:
class A{
fooMem=10;
static fooStat=10;
}
class B extends A{};
var b = new B();
alert(b.fooMem.toString());
alert(B.fooStat.toString());
Which would work if the documentation mentioned extends function is used : Test
Anybody know the reason why the documentation mentioned function was not used?
Bhas a static memberfooStat- that seems wrong reading the specs, but the generated JavaScript matches what the compiler thinks at least.