I have a class
function Node() {
//implementation
}
and another class
function AttributionalNode() {
this.prototype.setAttr = function (attr) {
this.atText = attr;
};
}
AttributionalNode.prototype = new Node();
AttributionalNode.prototype.constructor = AttributionalNode;
How to make class Node() so it can't be instantiated? e.g when I try
var node = new Node();
So it throws an Exception?
Aucun commentaire:
Enregistrer un commentaire