mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-12 17:45:49 +08:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user