MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / extractEvents

Function extractEvents

javascript/selenium-webdriver/generate_bidi.mjs:594–617  ·  view source on GitHub ↗

Extract all BiDi events by traversing EventData and extension XxxEvent unions.

(ast)

Source from the content-addressed store, hash-verified

592
593/** Extract all BiDi events by traversing EventData and extension XxxEvent unions. */
594function extractEvents(ast) {
595 const defMap = buildDefMap(ast)
596 const eventNames = collectAllMembers(defMap, 'Event')
597 const events = []
598
599 for (const name of eventNames) {
600 const def = defMap.get(name)
601 if (!def) continue
602
603 const parsed = parseLeafDef(def)
604 if (!parsed) continue
605
606 const { domain, methodStr, operationName: eventName, paramsCddl } = parsed
607
608 events.push({
609 domain,
610 methodStr,
611 eventName,
612 paramsCddl,
613 })
614 }
615
616 return events
617}
618
619// ============================================================
620// Binding-neutral model

Callers 1

buildModelFunction · 0.85

Calls 4

buildDefMapFunction · 0.85
collectAllMembersFunction · 0.85
parseLeafDefFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected