File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -877,30 +877,35 @@ Raven.prototype = {
877
877
)
878
878
return ;
879
879
880
- options = options || { } ;
880
+ options = Object . assign ( {
881
+ eventId : this . lastEventId ( ) ,
882
+ dsn : this . _dsn ,
883
+ user : this . _globalContext . user ,
884
+ } , options || { } ) ;
881
885
882
- var lastEventId = options . eventId || this . lastEventId ( ) ;
883
- if ( ! lastEventId ) {
886
+ if ( ! options . eventId ) {
884
887
throw new RavenConfigError ( 'Missing eventId' ) ;
885
888
}
886
889
887
- var dsn = options . dsn || this . _dsn ;
888
- if ( ! dsn ) {
890
+ if ( ! options . dsn ) {
889
891
throw new RavenConfigError ( 'Missing DSN' ) ;
890
892
}
891
893
892
894
var encode = encodeURIComponent ;
893
- var qs = '' ;
894
- qs += '?eventId=' + encode ( lastEventId ) ;
895
- qs += '&dsn=' + encode ( dsn ) ;
895
+ var qs = '?' ;
896
+ for ( var key in options ) {
897
+ if ( key !== 'user' ) {
898
+ qs += encode ( key ) + '=' + encode ( options [ key ] ) + '&' ;
899
+ }
900
+ }
896
901
897
- var user = options . user || this . _globalContext . user ;
902
+ var user = options . user ;
898
903
if ( user ) {
899
904
if ( user . name ) qs += '&name=' + encode ( user . name ) ;
900
905
if ( user . email ) qs += '&email=' + encode ( user . email ) ;
901
906
}
902
907
903
- var globalServer = this . _getGlobalServer ( this . _parseDSN ( dsn ) ) ;
908
+ var globalServer = this . _getGlobalServer ( this . _parseDSN ( options . dsn ) ) ;
904
909
905
910
var script = _document . createElement ( 'script' ) ;
906
911
script . async = true ;
You can’t perform that action at this time.
0 commit comments