From 97475fc365c59decd0727052e7574b32b841d707 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 17 Jul 2016 19:35:26 -0700 Subject: [PATCH] Remove `checkGlobal` helper. --- lodash.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lodash.js b/lodash.js index 95a7844ab..270757110 100644 --- a/lodash.js +++ b/lodash.js @@ -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`. *