index.js (902B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ 4 5 import { WorkerDispatcher } from "devtools/client/shared/worker-utils"; 6 7 const WORKER_URL = "resource://devtools/client/debugger/dist/parser-worker.js"; 8 9 export class ParserDispatcher extends WorkerDispatcher { 10 constructor(jestUrl) { 11 super(jestUrl || WORKER_URL); 12 } 13 14 getScopes = this.task("getScopes"); 15 async setSource(sourceId, content) { 16 const astSource = { 17 id: sourceId, 18 text: content.type === "wasm" ? "" : content.value, 19 contentType: content.contentType || null, 20 isWasm: content.type === "wasm", 21 }; 22 23 return this.invoke("setSource", astSource); 24 } 25 26 mapExpression = this.task("mapExpression"); 27 clearSources = this.task("clearSources"); 28 }