MCPcopy Create free account
hub / github.com/di-sukharev/opencommit / EventTarget2

Function EventTarget2

out/cli.cjs:10200–10216  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10198 return CustomEventTarget;
10199 }
10200 function EventTarget2() {
10201 if (this instanceof EventTarget2) {
10202 listenersMap.set(this, /* @__PURE__ */ new Map());
10203 return;
10204 }
10205 if (arguments.length === 1 && Array.isArray(arguments[0])) {
10206 return defineCustomEventTarget(arguments[0]);
10207 }
10208 if (arguments.length > 0) {
10209 const types = new Array(arguments.length);
10210 for (let i3 = 0; i3 < arguments.length; ++i3) {
10211 types[i3] = arguments[i3];
10212 }
10213 return defineCustomEventTarget(types);
10214 }
10215 throw new TypeError("Cannot call a class as a function");
10216 }
10217 EventTarget2.prototype = {
10218 /**
10219 * Add a given listener to this event target.

Callers

nothing calls this directly

Calls 2

defineCustomEventTargetFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected