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

R=aerotwist@chromium.org

Bug: chromium:1011811
Change-Id: Id8af2424186597f679dd08d87e137441b84d546b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2351786
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-12 13:23:47 +00:00
committed by Commit Bot
parent 3141f41937
commit 51d97b104f
+2 -11
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';
import {VBox} from './Widget.js';
@@ -33,19 +30,13 @@ export class ThrottledWidget extends VBox {
if (this._updateWhenVisible) {
return;
}
this._updateThrottler.schedule(innerUpdate.bind(this));
/**
* @this {ThrottledWidget}
* @return {!Promise<?>}
*/
function innerUpdate() {
this._updateThrottler.schedule(() => {
if (this.isShowing()) {
return this.doUpdate();
}
this._updateWhenVisible = true;
return Promise.resolve();
}
});
}
/**