MCPcopy Index your code
hub / github.com/nodejs/node / dispatchEvent

Method dispatchEvent

lib/internal/event_target.js:764–778  ·  view source on GitHub ↗

* @param {Event} event * @returns {boolean}

(event)

Source from the content-addressed store, hash-verified

762 * @returns {boolean}
763 */
764 dispatchEvent(event) {
765 if (!isEventTarget(this))
766 throw new ERR_INVALID_THIS('EventTarget');
767 if (arguments.length < 1)
768 throw new ERR_MISSING_ARGS('event');
769
770 if (!(event instanceof Event))
771 throw new ERR_INVALID_ARG_TYPE('event', 'Event', event);
772
773 if (event[kIsBeingDispatched])
774 throw new ERR_EVENT_RECURSION(event.type);
775
776 this[kHybridDispatch](event, event.type, event);
777 return event.defaultPrevented !== true;
778 }
779
780 [kHybridDispatch](nodeValue, type, event) {
781 const createEvent = () => {

Callers 15

mainFunction · 0.95
onceWithEventTargetFunction · 0.95
onceWithEventTargetErrorFunction · 0.95
testPassiveValueFunction · 0.95
testOptionEquivalenceFunction · 0.95
runAbortFunction · 0.80
oncloseFunction · 0.80
onMessageEventFunction · 0.80

Calls 1

isEventTargetFunction · 0.85

Tested by

no test coverage detected