Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix util.global #1441

Merged
merged 2 commits into from Jul 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/util/minimal.js
Expand Up @@ -26,8 +26,8 @@ util.pool = require("@protobufjs/pool");
util.LongBits = require("./longbits");

// global object reference
util.global = typeof window !== "undefined" && window
|| typeof global !== "undefined" && global
util.global = typeof global !== "undefined" && Object.prototype.toString.call(global) === "[object global]" && global
|| typeof window !== "undefined" && window
|| typeof self !== "undefined" && self
|| this; // eslint-disable-line no-invalid-this

Expand All @@ -52,9 +52,7 @@ util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next *
* @type {boolean}
* @const
*/
util.isNode = Boolean(typeof process !== "undefined" && process &&
typeof process.versions !== "undefined" && process.versions &&
process.versions.node);
util.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);

/**
* Tests if the specified value is an integer.
Expand Down