File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ function isInBrowser() {
2121 return ( ( typeof window !== 'undefined' ) && ( typeof XMLHttpRequest === 'function' ) ) ;
2222}
2323
24+ function hasGlobalProcessEventEmitter ( ) {
25+ return ( ( typeof process === 'object' ) && ( process !== null ) && ( typeof process . on === 'function' ) ) ;
26+ }
27+
2428function retrieveFile ( path ) {
2529 // Trim the path to make sure there is no extra whitespace.
2630 path = path . trim ( ) ;
@@ -418,7 +422,7 @@ exports.install = function(options) {
418422 // exception handler and the process will still be terminated. However, the
419423 // generated JavaScript code will be shown above the stack trace instead of
420424 // the original source code.
421- if ( installHandler && ! isInBrowser ( ) ) {
425+ if ( installHandler && hasGlobalProcessEventEmitter ( ) ) {
422426 shimEmitUncaughtException ( ) ;
423427 }
424428 }
You can’t perform that action at this time.
0 commit comments