Files
Nikolay Vitkov 2205050d6a [eslint] Add extensions folder to linting
Includes linting of the extensions folder.
Also add .mjs files to the PRESUBMIT which was previously missing.

Bug: none
Change-Id: I6ae5bb8a218461c3b2bf07d95310d79c57f2cdd9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6177277
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org>
2025-01-21 04:58:17 -08:00

44 lines
1.9 KiB
TypeScript

// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {RPCInterface} from '../src/DevToolsPluginWorker.js';
import {ResourceLoader} from '../src/MEMFSResourceLoader.js';
import type {WasmValue} from '../src/WasmTypes.js';
export interface TestWorkerInterface {
getWasmMemoryForTest(offset: number, length: number, stopId: unknown): Promise<ArrayBuffer>;
getWasmLocalForTest(local: number, stopId: unknown): Promise<WasmValue>;
getWasmGlobalForTest(global: number, stopId: unknown): Promise<WasmValue>;
getWasmOpForTest(op: number, stopId: unknown): Promise<WasmValue>;
reportResourceLoadForTest(
resourceUrl: string,
status: {success: boolean, errorMessage?: string|undefined, size?: number|undefined}): Promise<void>;
}
class TestWorker extends RPCInterface implements TestWorkerInterface {
async getWasmLocalForTest(local: number, stopId: unknown): Promise<WasmValue> {
return this.getWasmLocal(local, stopId);
}
async getWasmGlobalForTest(global: number, stopId: unknown): Promise<WasmValue> {
return this.getWasmGlobal(global, stopId);
}
async getWasmOpForTest(op: number, stopId: unknown): Promise<WasmValue> {
return this.getWasmOp(op, stopId);
}
async getWasmMemoryForTest(offset: number, length: number, stopId: unknown): Promise<ArrayBuffer> {
return this.getWasmLinearMemory(offset, length, stopId);
}
reportResourceLoadForTest(
resourceUrl: string,
status: {success: boolean, errorMessage?: string|undefined, size?: number|undefined}): Promise<void> {
return this.reportResourceLoad(resourceUrl, status);
}
}
// @ts-expect-error
if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
new TestWorker(self as any, new ResourceLoader());
}