Within a class that derives from Array<T>, I have a splice override:
public splice(start?: number, deleteCount?: number, ...items: T[]): T[] {
return super.splice(start, deleteCount, ...items);
}
Which compiles to...
SuperArray.prototype.splice = function (start, deleteCount) {
var items = [];
for (var _i = 2; _i < arguments.length; _i++) {
items[_i - 2] = arguments[_i];
}
return _super.prototype.splice.apply(this, [start, deleteCount].concat(items));
};
This doesn't work at all. It completely breaks splice! Is there something wrong with the way it compiles this .apply(this, [start, deleteCount].concat(items)) and how do I fix it?
What is happened with splice? Why it is broken?
array.splice(0); // array unaffected
splice? Why it is broken?