In a vein similar to making [] available to collections, one could make "new"
and "instanceof" available to other inheritance schemes.
For example:
// “Meta-class” for prototypes as classes/instantiable prototypes
function ProtoExemplars() {}
ProtoExamplar.prototype.{
operatorNew(...args) {
let inst = Object.create(this);
return inst.constructor(...args);
},
operatorInstanceof(lhs) {
return this.isPrototypeOf(lhs);
}
};
--
Dr. Axel Rauschmayer
[email protected]
home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss