Merge pull request #7223 from tchak/fix-js-events

fix(js): event-target-polyfill should not patch Event
This commit is contained in:
Paul Chavard 2022-04-29 20:13:38 +02:00 committed by GitHub
commit 5ddd7b1c25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,24 @@
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() {