File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ util.pool = require("@protobufjs/pool");
26
26
util . LongBits = require ( "./longbits" ) ;
27
27
28
28
// global object reference
29
- util . global = typeof window !== "undefined" && window
30
- || typeof global !== "undefined" && global
29
+ util . global = typeof global !== "undefined" && Object . prototype . toString . call ( global ) === "[object global]" && global
30
+ || typeof window !== "undefined" && window
31
31
|| typeof self !== "undefined" && self
32
32
|| this ; // eslint-disable-line no-invalid-this
33
33
@@ -52,9 +52,7 @@ util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next *
52
52
* @type {boolean }
53
53
* @const
54
54
*/
55
- util . isNode = Boolean ( typeof process !== "undefined" && process &&
56
- typeof process . versions !== "undefined" && process . versions &&
57
- process . versions . node ) ;
55
+ util . isNode = Boolean ( util . global . process && util . global . process . versions && util . global . process . versions . node ) ;
58
56
59
57
/**
60
58
* Tests if the specified value is an integer.
You can’t perform that action at this time.
0 commit comments