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

Function nameAllocator

javascript/selenium-webdriver/normalize_bidi_ast.mjs:81–90  ·  view source on GitHub ↗

A factory for collision-free synthetic def names within a known name set.

(existing)

Source from the content-addressed store, hash-verified

79
80/** A factory for collision-free synthetic def names within a known name set. */
81function nameAllocator(existing) {
82 const taken = new Set(existing)
83 return (candidate) => {
84 let name = candidate
85 let n = 2
86 while (taken.has(name)) name = `${candidate}${n++}`
87 taken.add(name)
88 return name
89 }
90}
91
92/** The vendor provenance a def synthesized out of `owner` inherits (none for a spec owner). */
93function inheritedVendor(owner) {

Callers 3

hoistInlineEnumsFunction · 0.85
hoistInlineRecordsFunction · 0.85

Calls 2

addMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected