Subclassing ES6 Set in javascript -
Subclassing ES6 Set in javascript -
i'm running problems when trying inherit new set
available in ecmascript 6. class defined such:
function selectionmanager () { set.call(this); } selectionmanager.prototype = object.create(set.prototype); selectionmanager.prototype.add = function (unit) { unit.setisselected(true); set.prototype.add.call(this, unit); }; /* functions left out */
when trying phone call add
next error: typeerror: set operation called on non-set object
the code available @ http://jsfiddle.net/6nq1gqx7/
the draft es6 states should possible subclass set, right way of doing so?
looks beingness tracked:
https://github.com/google/traceur-compiler/issues/1413
javascript set ecmascript-6 ecmascript-harmony
Comments
Post a Comment