From 51d97b104f7998cfec009f4de3376f613a4b1e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Z=C3=BCnd?= Date: Wed, 12 Aug 2020 12:15:03 +0200 Subject: [PATCH] [ts] Type-check ui/ThrottledWidget.js with TypeScript MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Commit-Queue: Simon Zünd --- front_end/ui/ThrottledWidget.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/front_end/ui/ThrottledWidget.js b/front_end/ui/ThrottledWidget.js index bca4e9753a..f9945834b0 100644 --- a/front_end/ui/ThrottledWidget.js +++ b/front_end/ui/ThrottledWidget.js @@ -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(); - } + }); } /**