MCPcopy
hub / github.com/blitz-js/blitz / eval

Method eval

integration-tests/utils/browsers/playwright.ts:263–276  ·  view source on GitHub ↗
(snippet)

Source from the content-addressed store, hash-verified

261 }
262
263 async eval(snippet) {
264 // TODO: should this and evalAsync be chained? Might lead
265 // to bad chains
266 return page
267 .evaluate(snippet)
268 .catch((err) => {
269 console.error("eval error:", err)
270 return null
271 })
272 .then(async (val) => {
273 await page.waitForLoadState()
274 return val
275 })
276 }
277
278 async evalAsync(snippet) {
279 if (typeof snippet === "function") {

Callers 1

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected