提交 0d605987 编写于 作者: J Joao Moreno

safeguard list splice calls

related to #53773
上级 a486f518
......@@ -929,6 +929,14 @@ export class List<T> implements ISpliceable<T>, IDisposable {
}
splice(start: number, deleteCount: number, elements: T[] = []): void {
if (start < 0 || start > this.view.length) {
throw new Error(`Invalid start index: ${start}`);
}
if (deleteCount < 0) {
throw new Error(`Invalid delete count: ${deleteCount}`);
}
if (deleteCount === 0 && elements.length === 0) {
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册