Skip to content

Commit

Permalink
event target
Browse files Browse the repository at this point in the history
  • Loading branch information
herudi committed Jul 30, 2024
1 parent 8502552 commit a2f719a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions web/js/event.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* Credit: https://www.npmjs.com/package/event-target-polyfill */
import { vjs_inspect } from "./util.js";

class Event {
constructor(type, opts = {}) {
this.bubbles = opts.bubbles ?? false;
Expand Down Expand Up @@ -83,6 +85,14 @@ class EventTarget {
}
return true;
}

[vjs_inspect](format) {
return "EventTarget " + format({
addEventListener: this.addEventListener,
dispatchEvent: this.dispatchEvent,
removeEventListener: this.removeEventListener,
});
}
}

globalThis.EventTarget = EventTarget;
Expand Down

0 comments on commit a2f719a

Please sign in to comment.