[ts] Type-check wasmparser_worker/WasmParserWorker.js with TypeScript

Bug: chromium:1011811
Change-Id: Icd9d84fab2f62b63b831a3ffa9b81165b7d06643
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2449589
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
This commit is contained in:
Benedikt Meurer
2020-10-05 14:45:09 +00:00
committed by Commit Bot
parent 59a84f1857
commit 2ec8265fe3
2 changed files with 7 additions and 13 deletions
@@ -28,9 +28,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// @ts-nocheck
// TODO(crbug.com/1011811): Enable TypeScript compiler checks
import * as Common from '../common/common.js';
import * as WasmDis from '../third_party/wasmparser/package/dist/esm/WasmDis.js';
import * as WasmParser from '../third_party/wasmparser/package/dist/esm/WasmParser.js';
@@ -59,10 +56,14 @@ class BinaryReaderWithProgress extends WasmParser.BinaryReader {
}
}
/**
*
* @param {!{data: !{method:string, params: !{content: string}}}} event
*/
self.onmessage = async function(event) {
const method = /** @type {string} */ (event.data.method);
const params = /** @type !{content: string} */ (event.data.params);
if (!method || method !== 'disassemble') {
const method = (event.data.method);
const params = (event.data.params);
if (method !== 'disassemble') {
return;
}
@@ -113,9 +114,3 @@ self.onmessage = async function(event) {
this.postMessage({method: 'disassemble', result: {source, offsets, functionBodyOffsets}});
};
/* Legacy exported object */
self.WasmParserWorker = self.WasmParserWorker || {};
/* Legacy exported object */
WasmParserWorker = WasmParserWorker || {};
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import * as WasmParserWorker from './WasmParserWorker.js';
export {