Skip to content

Commit

Permalink
Set default value for bubbles and cancelable
Browse files Browse the repository at this point in the history
Make sure bubbles and cancellable have a boolean value
  • Loading branch information
mischkl authored and kumarharsh committed Oct 31, 2018
1 parent d706af0 commit 4268c0b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions polyfill.js
Expand Up @@ -20,11 +20,9 @@
} catch (e) {
var CustomEvent = function(event, params) {
var evt, origPrevent;
params = params || {
bubbles: false,
cancelable: false,
detail: undefined
};
params = params || {};
params.bubbles = !!params.bubbles;
params.cancelable = !!params.cancelable;

evt = document.createEvent('CustomEvent');
evt.initCustomEvent(
Expand Down

0 comments on commit 4268c0b

Please sign in to comment.