@@ -37,25 +37,25 @@ extend(Raven.prototype, {
37
37
38
38
if ( arguments . length === 0 ) {
39
39
// no arguments, use default from environment
40
- dsn = process . env . SENTRY_DSN ;
40
+ dsn = global . process . env . SENTRY_DSN ;
41
41
options = { } ;
42
42
}
43
43
if ( typeof dsn === 'object' ) {
44
44
// They must only be passing through options
45
45
options = dsn ;
46
- dsn = process . env . SENTRY_DSN ;
46
+ dsn = global . process . env . SENTRY_DSN ;
47
47
}
48
48
options = options || { } ;
49
49
50
50
this . raw_dsn = dsn ;
51
51
this . dsn = utils . parseDSN ( dsn ) ;
52
- this . name = options . name || process . env . SENTRY_NAME || require ( 'os' ) . hostname ( ) ;
53
- this . root = options . root || process . cwd ( ) ;
52
+ this . name = options . name || global . process . env . SENTRY_NAME || require ( 'os' ) . hostname ( ) ;
53
+ this . root = options . root || global . process . cwd ( ) ;
54
54
this . transport = options . transport || transports [ this . dsn . protocol ] ;
55
55
this . sendTimeout = options . sendTimeout || 1 ;
56
- this . release = options . release || process . env . SENTRY_RELEASE || '' ;
56
+ this . release = options . release || global . process . env . SENTRY_RELEASE || '' ;
57
57
this . environment =
58
- options . environment || process . env . SENTRY_ENVIRONMENT || process . env . NODE_ENV || '' ;
58
+ options . environment || global . process . env . SENTRY_ENVIRONMENT || global . process . env . NODE_ENV || '' ;
59
59
60
60
// autoBreadcrumbs: true enables all, autoBreadcrumbs: false disables all
61
61
// autoBreadcrumbs: { http: true } enables a single type
@@ -94,7 +94,7 @@ extend(Raven.prototype, {
94
94
95
95
this . onFatalError = this . defaultOnFatalError = function ( err , sendErr , eventId ) {
96
96
console . error ( err && err . stack ? err . stack : err ) ;
97
- process . exit ( 1 ) ;
97
+ global . process . exit ( 1 ) ;
98
98
} ;
99
99
this . uncaughtErrorHandler = this . makeErrorHandler ( ) ;
100
100
@@ -112,11 +112,11 @@ extend(Raven.prototype, {
112
112
this . onFatalError = cb ;
113
113
}
114
114
115
- process . on ( 'uncaughtException' , this . uncaughtErrorHandler ) ;
115
+ global . process . on ( 'uncaughtException' , this . uncaughtErrorHandler ) ;
116
116
117
117
if ( this . captureUnhandledRejections ) {
118
118
var self = this ;
119
- process . on ( 'unhandledRejection' , function ( reason ) {
119
+ global . process . on ( 'unhandledRejection' , function ( reason ) {
120
120
self . captureException ( reason , function ( sendErr , eventId ) {
121
121
if ( ! sendErr ) utils . consoleAlert ( 'unhandledRejection captured: ' + eventId ) ;
122
122
} ) ;
@@ -136,8 +136,8 @@ extend(Raven.prototype, {
136
136
instrumentor . deinstrument ( this ) ;
137
137
138
138
// todo: this works for tests for now, but isn't what we ultimately want to be doing
139
- process . removeAllListeners ( 'uncaughtException' ) ;
140
- process . removeAllListeners ( 'unhandledRejection' ) ;
139
+ global . process . removeAllListeners ( 'uncaughtException' ) ;
140
+ global . process . removeAllListeners ( 'unhandledRejection' ) ;
141
141
142
142
this . installed = false ;
143
143
@@ -252,8 +252,8 @@ extend(Raven.prototype, {
252
252
kwargs . modules = utils . getModules ( ) ;
253
253
kwargs . server_name = kwargs . server_name || this . name ;
254
254
255
- if ( typeof process . version !== 'undefined' ) {
256
- kwargs . extra . node = process . version ;
255
+ if ( typeof global . process . version !== 'undefined' ) {
256
+ kwargs . extra . node = global . process . version ;
257
257
}
258
258
259
259
kwargs . environment = kwargs . environment || this . environment ;
0 commit comments