* Apply Selenium vendor overlay CDDL (see common/bidi/*-extensions.cddl) to the AST. Each * `--vendor-cddl` is ` = `, the namespace being the wire prefix the vendor owns * (`moz` for `moz:` fields). A vendor overlay extends a spec type through a ` Extension` * group of typed b
(ast, vendorArgs)
| 192 | * out of the shared, browser-neutral schema into a separate `vendor` section. |
| 193 | */ |
| 194 | function applyVendor(ast, vendorArgs) { |
| 195 | if (!vendorArgs.length) return ast |
| 196 | const specGroups = new Set(ast.filter((d) => d?.Type === 'group').map((d) => d.Name)) |
| 197 | const vendorDefs = vendorArgs.flatMap((arg) => { |
| 198 | const [namespace, file] = splitVendorArg(arg) |
| 199 | return tagVendorDefs(parseCddl(file), namespace, specGroups) |
| 200 | }) |
| 201 | return [...ast, ...vendorDefs] |
| 202 | } |
| 203 | |
| 204 | function splitVendorArg(arg) { |
| 205 | const i = arg.indexOf('=') |
no test coverage detected