MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / evaluate

Method evaluate

telemetry-dashboard/scripts/render-check.mjs:131–141  ·  view source on GitHub ↗

Runs an expression in the page and returns its value, awaiting promises.

(sessionId, expression)

Source from the content-addressed store, hash-verified

129
130 /** Runs an expression in the page and returns its value, awaiting promises. */
131 async evaluate(sessionId, expression) {
132 const result = await this.send(
133 'Runtime.evaluate',
134 { expression, returnByValue: true, awaitPromise: true },
135 sessionId,
136 );
137 if (result.exceptionDetails) {
138 throw new Error(result.exceptionDetails.exception?.description ?? 'page threw');
139 }
140 return result.result.value;
141 }
142}
143
144// ---------------------------------------------------------------------------

Callers 1

mainFunction · 0.80

Calls 1

sendMethod · 0.95

Tested by

no test coverage detected