MCPcopy
hub / github.com/SeleniumHQ/selenium / toExecuteAtomCommand

Function toExecuteAtomCommand

javascript/selenium-webdriver/lib/http.js:178–190  ·  view source on GitHub ↗

* @param {!cmd.Command} command The initial command. * @param {Atom} atom The name of the atom to execute. * @param params * @return {!Command} The transformed command to execute.

(command, atom, name, ...params)

Source from the content-addressed store, hash-verified

176 * @return {!Command} The transformed command to execute.
177 */
178function toExecuteAtomCommand(command, atom, name, ...params) {
179 if (typeof atom !== 'function') {
180 throw new InternalTypeError('atom is not a function: ' + typeof atom)
181 }
182
183 return new cmd.Command(cmd.Name.EXECUTE_SCRIPT)
184 .setParameter('sessionId', command.getParameter('sessionId'))
185 .setParameter('script', `/* ${name} */return (${atom}).apply(null, arguments)`)
186 .setParameter(
187 'args',
188 params.map((param) => command.getParameter(param)),
189 )
190}
191
192/** @const {!Map<string, (CommandSpec|CommandTransformer)>} */
193const W3C_COMMAND_MAP = new Map([

Callers 1

http.jsFile · 0.85

Calls 3

setParameterMethod · 0.80
getParameterMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected