File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -614,7 +614,7 @@ function send(data) {
614
614
// Send along an event_id if not explicitly passed.
615
615
// This event_id can be used to reference the error within Sentry itself.
616
616
// Set lastEventId after we know the error should actually be sent
617
- lastEventId = data . event_id || ( data . event_id = generateUUID4 ( ) ) ;
617
+ lastEventId = data . event_id || ( data . event_id = uuid4 ( ) ) ;
618
618
619
619
makeRequest ( data ) ;
620
620
}
@@ -673,16 +673,19 @@ function joinRegExp(patterns) {
673
673
}
674
674
675
675
// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
676
- function generateUUID4 ( ) {
676
+ function uuid4 ( ) {
677
677
return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx' . replace ( / [ x y ] / g, function ( c ) {
678
678
var r = Math . random ( ) * 16 | 0 ,
679
679
v = c == 'x' ? r : ( r & 0x3 | 0x8 ) ;
680
680
return v . toString ( 16 ) ;
681
681
} ) ;
682
682
}
683
683
684
- // Attempt to initialize Raven on load
685
- var RavenConfig = window . RavenConfig ;
686
- if ( RavenConfig ) {
687
- Raven . config ( RavenConfig . dsn , RavenConfig . config ) . install ( ) ;
684
+ function afterLoad ( ) {
685
+ // Attempt to initialize Raven on load
686
+ var RavenConfig = window . RavenConfig ;
687
+ if ( RavenConfig ) {
688
+ Raven . config ( RavenConfig . dsn , RavenConfig . config ) . install ( ) ;
689
+ }
688
690
}
691
+ afterLoad ( ) ;
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ function setupRaven() {
36
36
}
37
37
38
38
// patched to return a predictable result
39
- function generateUUID4 ( ) {
39
+ function uuid4 ( ) {
40
40
return 'abc123' ;
41
41
}
42
42
@@ -998,7 +998,7 @@ describe('Raven (public API)', function() {
998
998
this . sinon . stub ( window , 'isSetup' ) . returns ( false ) ;
999
999
this . sinon . stub ( TraceKit . report , 'subscribe' ) ;
1000
1000
1001
- Raven . afterLoad ( ) ;
1001
+ afterLoad ( ) ;
1002
1002
1003
1003
assert . equal ( globalKey , 'random' ) ;
1004
1004
assert . equal ( globalServer , 'http://some.other.server:80/api/2/store/' ) ;
You can’t perform that action at this time.
0 commit comments