Skip to content

Commit

Permalink
Fixes #1190
Browse files Browse the repository at this point in the history
  • Loading branch information
lextiz authored and petkaantonov committed Aug 24, 2016
1 parent 77f7711 commit e820d8a
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/debuggability.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,24 @@ Promise.hasLongStackTraces = function () {

var fireDomEvent = (function() {
try {
var event = document.createEvent("CustomEvent");
event.initCustomEvent("testingtheevent", false, true, {});
util.global.dispatchEvent(event);
return function(name, event) {
var domEvent = document.createEvent("CustomEvent");
domEvent.initCustomEvent(name.toLowerCase(), false, true, event);
return !util.global.dispatchEvent(domEvent);
};
if (typeof CustomEvent === "function") {
var event = new CustomEvent("CustomEvent");
util.global.dispatchEvent(event);
return function(name, event) {
var domEvent = new CustomEvent(name.toLowerCase(), event);
return !util.global.dispatchEvent(domEvent);
};
} else {
var event = document.createEvent("CustomEvent");
event.initCustomEvent("testingtheevent", false, true, {});
util.global.dispatchEvent(event);
return function(name, event) {
var domEvent = document.createEvent("CustomEvent");
domEvent.initCustomEvent(name.toLowerCase(), false, true,
event);
return !util.global.dispatchEvent(domEvent);
};
}
} catch (e) {}
return function() {
return false;
Expand Down

0 comments on commit e820d8a

Please sign in to comment.