Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化控制台显示(#9), 修复triggerEvent报错 #14

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 14 additions & 6 deletions build/raven.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ var wrapMethod = function(console, level, callback) {

console[level] = function() {
var args = [].slice.call(arguments);

var msg = '' + args.join(' ');

var msg = '' + args.map(function(arg) {
if (typeof arg === 'object') {
return JSON.stringify(arg);
}
return arg;
}).join(' ');
var data = {level: sentryLevel, logger: 'console', extra: {arguments: args}};

if (level === 'assert') {
Expand Down Expand Up @@ -836,7 +841,7 @@ Raven.prototype = {

_triggerEvent: function(eventType, options) {
// NOTE: `event` is a native browser thing, so let's avoid conflicting wiht it
var evt, key;
var evt = {}, key;

if (!this._hasDocument) return;

Expand All @@ -847,7 +852,8 @@ Raven.prototype = {
if (_document.createEvent) {
evt = _document.createEvent('HTMLEvents');
evt.initEvent(eventType, true, true);
} else {
}
if (_document.createEventObject) {
evt = _document.createEventObject();
evt.eventType = eventType;
}
Expand All @@ -860,7 +866,9 @@ Raven.prototype = {
if (_document.createEvent) {
// IE9 if standards
_document.dispatchEvent(evt);
} else {
return;
}
if (_document.createEventObject) {
// IE8 regardless of Quirks or Standards
// IE9 if quirks
try {
Expand Down Expand Up @@ -3121,4 +3129,4 @@ function serializer(replacer, cycleReplacer) {
}

},{}]},{},[4])(4)
});
});
2 changes: 1 addition & 1 deletion build/raven.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/raven.min.js.map

Large diffs are not rendered by default.

Loading