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

Function extractEvents

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

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

(ast)

Source from the content-addressed store, hash-verified

538
539/** Extract all BiDi events by traversing EventData and extension XxxEvent unions. */
540function extractEvents(ast) {
541 const defMap = buildDefMap(ast)
542 const eventNames = collectAllMembers(defMap, 'Event')
543 const events = []
544
545 for (const name of eventNames) {
546 const def = defMap.get(name)
547 if (!def) continue
548
549 const parsed = parseLeafDef(def)
550 if (!parsed) continue
551
552 const { domain, methodStr, operationName: eventName, paramsCddl, vendor } = parsed
553
554 events.push({
555 domain,
556 methodStr,
557 eventName,
558 paramsCddl,
559 vendor,
560 })
561 }
562
563 return events
564}
565
566// ============================================================
567// 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