[ts] Type-check ui/ListModel.js with TypeScript

R=aerotwist@chromium.org

Bug: chromium:1011811
Change-Id: I806598d864d40eab506b1e02483fad8168aba3f2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2352728
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
This commit is contained in:
Simon Zünd
2020-08-18 07:26:28 +00:00
committed by Commit Bot
parent 21a9ca3799
commit 724fb45f8d
+2 -4
View File
@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @ts-nocheck
// TODO(crbug.com/1011811): Enable TypeScript compiler checks
import * as Common from '../common/common.js';
/**
@@ -17,6 +14,7 @@ export class ListModel extends Common.ObjectWrapper.ObjectWrapper {
*/
constructor(items) {
super();
/** @type {!Array<T>} */
this._items = items || [];
}
@@ -146,7 +144,7 @@ export class ListModel extends Common.ObjectWrapper.ObjectWrapper {
// Splice may fail with too many arguments.
const before = this._items.slice(0, from);
const after = this._items.slice(to);
this._items = [].concat(before, items, after);
this._items = [...before, ...items, ...after];
}
this._replaced(from, removed, items.length);
return removed;