demarches-normaliennes/patches/event-target-polyfill+0.0.3.patch

53 lines
2.3 KiB
Diff

diff --git a/node_modules/event-target-polyfill/index.js b/node_modules/event-target-polyfill/index.js
index 82f7f42..c7b65b7 100644
--- a/node_modules/event-target-polyfill/index.js
+++ b/node_modules/event-target-polyfill/index.js
@@ -12,19 +12,6 @@ function isConstructor(fn) {
return true;
}
-if (typeof root.Event !== "function" || !isConstructor(root.Event)) {
- root.Event = (function () {
- function Event(type, options) {
- this.bubbles = !!options && !!options.bubbles;
- this.cancelable = !!options && !!options.cancelable;
- this.composed = !!options && !!options.composed;
- this.type = type;
- }
-
- return Event;
- })();
-}
-
if (typeof root.EventTarget === "undefined" || !isConstructor(root.Event)) {
root.EventTarget = (function () {
function EventTarget() {
@@ -40,7 +27,8 @@ if (typeof root.EventTarget === "undefined" || !isConstructor(root.Event)) {
) {
if (arguments.length < 2) {
throw new TypeError(
- `TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only ${arguments.length} present.`
+ "TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, " \
+ "but only " + arguments.length.toString() + "present."
);
}
const __listeners = this.__listeners;
@@ -62,7 +50,8 @@ if (typeof root.EventTarget === "undefined" || !isConstructor(root.Event)) {
) {
if (arguments.length < 2) {
throw new TypeError(
- `TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only ${arguments.length} present.`
+ "TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, " \
+ "but only " + arguments.length.toString() + "present."
);
}
const __listeners = this.__listeners;
@@ -78,7 +67,7 @@ if (typeof root.EventTarget === "undefined" || !isConstructor(root.Event)) {
EventTarget.prototype.dispatchEvent = function (event) {
if (!(event instanceof Event)) {
throw new TypeError(
- `Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.`
+ "Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'."
);
}
const type = event.type;