MCPcopy Create free account
hub / github.com/Snapchat/Valdi / _getArraySlots

Method _getArraySlots

valdi/vscode_debugger/src/adapter/variables.ts:449–474  ·  view source on GitHub ↗
(
    object: RemoteObject,
    params?: Dap.VariablesParams,
  )

Source from the content-addressed store, hash-verified

447 }
448
449 private async _getArraySlots(
450 object: RemoteObject,
451 params?: Dap.VariablesParams,
452 ): Promise<Dap.Variable[]> {
453 const start = params && typeof params.start !== 'undefined' ? params.start : -1;
454 const count = params && typeof params.count !== 'undefined' ? params.count : -1;
455 let objectId: string;
456 try {
457 const response = await getArraySlots({
458 cdp: object.cdp,
459 generatePreview: false,
460 args: [start, count],
461 objectId: object.objectId,
462 });
463
464 objectId = response.objectId;
465 } catch (e) {
466 return [];
467 }
468
469 const result = (await this._getObjectProperties(object, objectId)).filter(
470 p => p.name !== '__proto__',
471 );
472 await this._cdp.Runtime.releaseObject({ objectId });
473 return result;
474 }
475
476 private _createVariableReference(object: RemoteObject): number {
477 const reference = ++VariableStore._lastVariableReference;

Callers 1

getVariablesMethod · 0.95

Calls 3

_getObjectPropertiesMethod · 0.95
filterMethod · 0.80
releaseObjectMethod · 0.65

Tested by

no test coverage detected