@appsurify-testmap/rrdom-nodejs 2.0.0-alpha.40 → 2.0.0-alpha.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,20 +32,27 @@ const interactiveEvents = [
32
32
  "touchcancel"
33
33
  ];
34
34
  const interactiveElementsRegistry = /* @__PURE__ */ new WeakSet();
35
- const originalAddEventListener = EventTarget.prototype.addEventListener;
36
- EventTarget.prototype.addEventListener = function(type, listener, options) {
37
- originalAddEventListener.call(this, type, listener, options);
38
- if (this instanceof Element) {
39
- const eventType = type.toLowerCase();
40
- if (interactiveEvents.includes(eventType)) {
41
- interactiveElementsRegistry.add(this);
35
+ if (typeof Element !== "undefined" && typeof EventTarget !== "undefined") {
36
+ const originalAddEventListener = EventTarget.prototype.addEventListener;
37
+ EventTarget.prototype.addEventListener = function(type, listener, options) {
38
+ originalAddEventListener.call(this, type, listener, options);
39
+ if (this instanceof Element) {
40
+ const eventType = type.toLowerCase();
41
+ if (interactiveEvents.includes(eventType)) {
42
+ interactiveElementsRegistry.add(this);
43
+ }
42
44
  }
43
- }
44
- };
45
- const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
46
- EventTarget.prototype.removeEventListener = function(type, listener, options) {
47
- originalRemoveEventListener.call(this, type, listener, options);
48
- };
45
+ };
46
+ }
47
+ if (typeof Element !== "undefined" && typeof EventTarget !== "undefined") {
48
+ const originalRemoveEventListener = EventTarget.prototype.removeEventListener;
49
+ EventTarget.prototype.removeEventListener = function(type, listener, options) {
50
+ originalRemoveEventListener.call(this, type, listener, options);
51
+ if (this instanceof Element) {
52
+ type.toLowerCase();
53
+ }
54
+ };
55
+ }
49
56
  function getDefaultExportFromCjs(x2) {
50
57
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
51
58
  }