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

Function applyOverrides

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

* Apply Selenium overlay CDDL (see common/bidi/) to the parsed upstream AST: any * production an overlay defines replaces the identically named upstream one, which is * dropped. Kept here rather than in the shared CDDL merge so the overlay is a * schema-generation concern only — the upstream gram

(ast, overrideArgs)

Source from the content-addressed store, hash-verified

209 * any other definition.
210 */
211function applyOverrides(ast, overrideArgs) {
212 if (!overrideArgs.length) return ast
213 const overrides = overrideArgs.flatMap((arg) => parseCddl(arg))
214 const names = new Set(overrides.filter((d) => d?.Name).map((d) => d.Name))
215 return [...ast.filter((d) => !(d?.Name && names.has(d.Name))), ...overrides]
216}
217
218/**
219 * Apply Selenium vendor overlay CDDL (see common/bidi/*-extensions.cddl) to the AST.

Callers 1

mainFunction · 0.85

Calls 4

parseCddlFunction · 0.85
filterMethod · 0.80
mapMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected