Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/raven.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ var Raven = {
function triggerEvent(eventType, options) {
var event, key;

eventType = 'raven' + eventType[0].toUpperCase() + eventType.substr(1);
eventType = 'raven' + eventType.substr(0,1).toUpperCase() + eventType.substr(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, substring(0, 1) is generally a tiny bit faster.


if (document.createEvent) {
event = document.createEvent('HTMLEvents');
Expand All @@ -254,9 +254,14 @@ function triggerEvent(eventType, options) {
}

if (document.createEvent) {
// IE9 if standards
document.dispatchEvent(event);
} else {
document.fireEvent('on' + event.eventType.toLowerCase(), event);
// IE8 regardless of Quirks or Standards
// IE9 if quirks
try {
document.fireEvent('on' + event.eventType.toLowerCase(), event);
} catch(e) {}
}
}

Expand Down