class B {
constructor(x) {
this.x = x;
}
static [Symbol.create]() {
var o = super();
weakMap.set(o, 123456789); // Dom wrapper foo
return o;
}
}
function C(x) {
B.call(this, x);
}
C.__proto__ = B;
C.prototype = {
__proto__: B.prototype,
constructor: C
};
or
class B {
constructor(x) {
this.x = x;
}
static [Symbol.new](x) {
var o = super();
weakMap.set(o, 123456789); // Dom wrapper foo
this.call(o, x);
return o;
}
}
But this is just @@create
in sheep's clothing...
class B {
constructor(x) {
this.x = x;
}
static [Symbol.create]() {
var o = super();
weakMap.set(o, 123456789); // Dom wrapper foo
return o;
}
static [Symbol.new](x) {
var o = this[Symbol.create]();
this.call(o, x);
return o;
}
}