()
| 188 | } |
| 189 | |
| 190 | private async loadTextContent(): Promise<TextUtils.ContentData.ContentData> { |
| 191 | const result = await this.debuggerModel.target().debuggerAgent().invoke_getScriptSource({scriptId: this.scriptId}); |
| 192 | if (result.getError()) { |
| 193 | throw new Error(result.getError()); |
| 194 | } |
| 195 | const {scriptSource, bytecode} = result; |
| 196 | if (bytecode) { |
| 197 | return new TextUtils.ContentData.ContentData(bytecode, /* isBase64 */ true, 'application/wasm'); |
| 198 | } |
| 199 | let content: string = scriptSource || ''; |
| 200 | if (this.hasSourceURL && Common.ParsedURL.schemeIs(this.sourceURL, 'snippet:')) { |
| 201 | // TODO(crbug.com/1330846): Find a better way to establish the snippet automapping binding then adding |
| 202 | // a sourceURL comment before evaluation and removing it here. |
| 203 | content = Script.trimSourceURLComment(content); |
| 204 | } |
| 205 | return new TextUtils.ContentData.ContentData(content, /* isBase64 */ false, 'text/javascript'); |
| 206 | } |
| 207 | |
| 208 | private async loadWasmContent(): Promise<TextUtils.ContentData.ContentDataOrError> { |
| 209 | if (!this.isWasm()) { |
no test coverage detected