Remove checkGlobal helper.

This commit is contained in:
John-David Dalton
2016-07-17 19:35:26 -07:00
parent ea7aa52ea3
commit 97475fc365

View File

@@ -361,10 +361,10 @@
freeParseInt = parseInt;
/** Detect free variable `global` from Node.js. */
var freeGlobal = checkGlobal(typeof global == 'object' && global);
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
/** Detect free variable `self`. */
var freeSelf = checkGlobal(typeof self == 'object' && self);
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
@@ -1014,17 +1014,6 @@
return index;
}
/**
* Checks if `value` is a global object.
*
* @private
* @param {*} value The value to check.
* @returns {null|Object} Returns `value` if it's a global object, else `null`.
*/
function checkGlobal(value) {
return (value && value.Object === Object) ? value : null;
}
/**
* Gets the number of `placeholder` occurrences in `array`.
*