MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / extractEvents

Function extractEvents

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

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

(ast)

Source from the content-addressed store, hash-verified

561
562/** Extract all BiDi events by traversing EventData and extension XxxEvent unions. */
563function extractEvents(ast) {
564 const defMap = buildDefMap(ast)
565 const eventNames = collectAllMembers(defMap, 'Event')
566 const events = []
567
568 for (const name of eventNames) {
569 const def = defMap.get(name)
570 if (!def) continue
571
572 const parsed = parseLeafDef(def)
573 if (!parsed) continue
574
575 const { domain, methodStr, operationName: eventName, paramsCddl, vendor } = parsed
576
577 events.push({
578 domain,
579 methodStr,
580 eventName,
581 paramsCddl,
582 vendor,
583 })
584 }
585
586 return events
587}
588
589// ============================================================
590// Binding-neutral model

Callers 1

buildModelFunction · 0.85

Calls 5

buildDefMapFunction · 0.85
collectAllMembersFunction · 0.85
parseLeafDefFunction · 0.85
pushMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected