1
- /*! Raven.js 3.0.4 (0784c3c ) | github.com/getsentry/raven-js */
1
+ /*! Raven.js 3.1.0 (d781478 ) | github.com/getsentry/raven-js */
2
2
3
3
/*
4
4
* Includes TraceKit
@@ -150,7 +150,7 @@ Raven.prototype = {
150
150
// webpack (using a build step causes webpack #1617). Grunt verifies that
151
151
// this value matches package.json during build.
152
152
// See: https://github.com/getsentry/raven-js/issues/465
153
- VERSION : '3.0.4 ' ,
153
+ VERSION : '3.1.0 ' ,
154
154
155
155
debug : false ,
156
156
@@ -210,14 +210,6 @@ Raven.prototype = {
210
210
this . _globalEndpoint = this . _globalServer +
211
211
'/' + path + 'api/' + this . _globalProject + '/store/' ;
212
212
213
- if ( this . _globalOptions . fetchContext ) {
214
- TraceKit . remoteFetching = true ;
215
- }
216
-
217
- if ( this . _globalOptions . linesOfContext ) {
218
- TraceKit . linesOfContext = this . _globalOptions . linesOfContext ;
219
- }
220
-
221
213
TraceKit . collectWindowErrors = ! ! this . _globalOptions . collectWindowErrors ;
222
214
223
215
// return for chaining
@@ -885,8 +877,15 @@ Raven.prototype = {
885
877
// Capture breadcrubms from any click that is unhandled / bubbled up all the way
886
878
// to the document. Do this before we instrument addEventListener.
887
879
if ( this . _hasDocument ) {
888
- document . addEventListener ( 'click' , self . _breadcrumbEventHandler ( 'click' ) ) ;
889
- document . addEventListener ( 'keypress' , self . _keypressEventHandler ( ) ) ;
880
+ if ( document . addEventListener ) {
881
+ document . addEventListener ( 'click' , self . _breadcrumbEventHandler ( 'click' ) ) ;
882
+ document . addEventListener ( 'keypress' , self . _keypressEventHandler ( ) ) ;
883
+ }
884
+ else {
885
+ // IE8 Compatibility
886
+ document . attachEvent ( 'onclick' , self . _breadcrumbEventHandler ( 'click' ) ) ;
887
+ document . attachEvent ( 'onkeypress' , self . _keypressEventHandler ( ) ) ;
888
+ }
890
889
}
891
890
892
891
// event targets borrowed from bugsnag-js:
@@ -1106,13 +1105,7 @@ Raven.prototype = {
1106
1105
lineno : frame . line ,
1107
1106
colno : frame . column ,
1108
1107
'function' : frame . func || '?'
1109
- } , context = this . _extractContextFromFrame ( frame ) , i ;
1110
-
1111
- if ( context ) {
1112
- var keys = [ 'pre_context' , 'context_line' , 'post_context' ] ;
1113
- i = 3 ;
1114
- while ( i -- ) normalized [ keys [ i ] ] = context [ i ] ;
1115
- }
1108
+ } ;
1116
1109
1117
1110
normalized . in_app = ! ( // determine if an exception came from outside of our app
1118
1111
// first we check the global includePaths list.
@@ -1126,45 +1119,6 @@ Raven.prototype = {
1126
1119
return normalized ;
1127
1120
} ,
1128
1121
1129
- _extractContextFromFrame : function ( frame ) {
1130
- // immediately check if we should even attempt to parse a context
1131
- if ( ! frame . context || ! this . _globalOptions . fetchContext ) return ;
1132
-
1133
- var context = frame . context ,
1134
- pivot = ~ ~ ( context . length / 2 ) ,
1135
- i = context . length , isMinified = false ;
1136
-
1137
- while ( i -- ) {
1138
- // We're making a guess to see if the source is minified or not.
1139
- // To do that, we make the assumption if *any* of the lines passed
1140
- // in are greater than 300 characters long, we bail.
1141
- // Sentry will see that there isn't a context
1142
- if ( context [ i ] . length > 300 ) {
1143
- isMinified = true ;
1144
- break ;
1145
- }
1146
- }
1147
-
1148
- if ( isMinified ) {
1149
- // The source is minified and we don't know which column. Fuck it.
1150
- if ( isUndefined ( frame . column ) ) return ;
1151
-
1152
- // If the source is minified and has a frame column
1153
- // we take a chunk of the offending line to hopefully shed some light
1154
- return [
1155
- [ ] , // no pre_context
1156
- context [ pivot ] . substr ( frame . column , 50 ) , // grab 50 characters, starting at the offending column
1157
- [ ] // no post_context
1158
- ] ;
1159
- }
1160
-
1161
- return [
1162
- context . slice ( 0 , pivot ) , // pre_context
1163
- context [ pivot ] , // context_line
1164
- context . slice ( pivot + 1 ) // post_context
1165
- ] ;
1166
- } ,
1167
-
1168
1122
_processException : function ( type , message , fileurl , lineno , frames , options ) {
1169
1123
var stacktrace , fullMessage ;
1170
1124
@@ -1734,10 +1688,7 @@ var isUndefined = utils.isUndefined;
1734
1688
*/
1735
1689
1736
1690
var TraceKit = {
1737
- remoteFetching : false ,
1738
1691
collectWindowErrors : true ,
1739
- // 3 lines before, the offending line, 3 lines after
1740
- linesOfContext : 7 ,
1741
1692
debug : false
1742
1693
} ;
1743
1694
@@ -1897,7 +1848,6 @@ TraceKit.report = (function reportModuleWrapper() {
1897
1848
}
1898
1849
1899
1850
location . func = UNKNOWN_FUNCTION ;
1900
- location . context = null ;
1901
1851
1902
1852
stack = {
1903
1853
'name' : name ,
@@ -2000,7 +1950,6 @@ TraceKit.report = (function reportModuleWrapper() {
2000
1950
* s.stack[i].args - arguments passed to the function, if known
2001
1951
* s.stack[i].line - line number, if known
2002
1952
* s.stack[i].column - column number, if known
2003
- * s.stack[i].context - an array of source code lines; the middle element corresponds to the correct line#
2004
1953
*
2005
1954
* Supports:
2006
1955
* - Firefox: full stack trace with line numbers and unreliable column
@@ -2150,10 +2099,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
2150
2099
element . func = UNKNOWN_FUNCTION ;
2151
2100
}
2152
2101
2153
- if ( element . line ) {
2154
- element . context = null ;
2155
- }
2156
-
2157
2102
stack . push ( element ) ;
2158
2103
}
2159
2104
@@ -2219,7 +2164,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
2219
2164
if ( ! element . func && element . line ) {
2220
2165
element . func = UNKNOWN_FUNCTION ;
2221
2166
}
2222
- element . context = [ lines [ line + 1 ] ] ;
2223
2167
2224
2168
stack . push ( element ) ;
2225
2169
}
@@ -2307,7 +2251,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
2307
2251
if ( ! item . func ) {
2308
2252
item . func = UNKNOWN_FUNCTION ;
2309
2253
}
2310
- item . context = [ lines [ line + 1 ] ] ;
2311
2254
2312
2255
stack . push ( item ) ;
2313
2256
}
@@ -2357,7 +2300,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
2357
2300
return false ; // already in stack trace
2358
2301
} else if ( ! stackInfo . stack [ 0 ] . line && stackInfo . stack [ 0 ] . func === initial . func ) {
2359
2302
stackInfo . stack [ 0 ] . line = initial . line ;
2360
- stackInfo . stack [ 0 ] . context = initial . context ;
2361
2303
return false ;
2362
2304
}
2363
2305
}
0 commit comments