MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / getScript

Method getScript

src/debug/threads.ts:337–360  ·  view source on GitHub ↗
(scriptRef: VMScriptRef)

Source from the content-addressed store, hash-verified

335 }
336
337 public getScript(scriptRef: VMScriptRef): Promise<VMScript> {
338 const scriptId = scriptRef.id;
339
340 if (this.scriptCompleters[scriptId]) {
341 const completer: PromiseCompleter<VMScript> = this.scriptCompleters[scriptId];
342 return completer.promise;
343 } else {
344 const completer: PromiseCompleter<VMScript> = new PromiseCompleter();
345 this.scriptCompleters[scriptId] = completer;
346
347 if (this.manager.debugSession.vmService) {
348 this.manager.debugSession.vmService.getObject(this.ref.id, scriptRef.id).then((result: DebuggerResult) => {
349 const script: VMScript = result.result as VMScript;
350 completer.resolve(script);
351 }).catch((error) => {
352 completer.reject(error);
353 });
354 } else {
355 completer.reject(`VM service connection is no longer available`);
356 }
357
358 return completer.promise;
359 }
360 }
361
362 public storeData(data: VMResponse): number {
363 return this.manager.storeData(this, data);

Callers 3

sourceRequestFunction · 0.80
convertStackFrameFunction · 0.80
resolveWebviewViewFunction · 0.80

Calls 1

getObjectMethod · 0.80

Tested by

no test coverage detected