MCPcopy Create free account
hub / github.com/microsoft/SandDance / _handlerIndex

Function _handlerIndex

docs/app/js/sanddance-app.js:123323–123328  ·  view source on GitHub ↗

* Utility method for finding the array index of an event handler. * @param {Array} h - An array of registered event handlers. * @param {string} type - The event type. * @param {function} handler - The event handler instance to find. * @return {number} - The handler's array index or -1 if

(h17, type8, handler)

Source from the content-addressed store, hash-verified

123321 * @param {function} handler - The event handler instance to find.
123322 * @return {number} - The handler's array index or -1 if not registered.
123323 */ _handlerIndex (h17, type8, handler) {
123324 for(let i = h17 ? h17.length : 0; --i >= 0;){
123325 if (h17[i].type === type8 && (!handler || h17[i].handler === handler)) return i;
123326 }
123327 return -1;
123328 },
123329 /**
123330 * Returns an array with registered event handlers.
123331 * @param {string} [type] - The event type to query. Any annotations

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected