Skip to content

Commit

Permalink
Remove es6 set to fix compatibility issues in old browsers (video-dev…
Browse files Browse the repository at this point in the history
  • Loading branch information
johnBartos authored Nov 2, 2018
1 parent 3352ba5 commit fed6606
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/event-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { logger } from './utils/logger';
import { ErrorTypes, ErrorDetails } from './errors';
import Event from './events';

const FORBIDDEN_EVENT_NAMES = new Set([
'hlsEventGeneric',
'hlsHandlerDestroying',
'hlsHandlerDestroyed'
]);
const FORBIDDEN_EVENT_NAMES = {
'hlsEventGeneric': true,
'hlsHandlerDestroying': true,
'hlsHandlerDestroyed': true
};

class EventHandler {
constructor (hls, ...events) {
Expand Down Expand Up @@ -40,7 +40,7 @@ class EventHandler {
registerListeners () {
if (this.isEventHandler()) {
this.handledEvents.forEach(function (event) {
if (FORBIDDEN_EVENT_NAMES.has(event)) {
if (FORBIDDEN_EVENT_NAMES[event]) {
throw new Error('Forbidden event-name: ' + event);
}

Expand Down

0 comments on commit fed6606

Please sign in to comment.