From df172443537f74145ad83775f1717cf2c79de85e Mon Sep 17 00:00:00 2001 From: Oliver Hoffmann Date: Mon, 13 Jul 2015 19:49:05 +0200 Subject: [PATCH] Update `root` assignment to work in Firefox extensions. [closes #1340] --- lodash.src.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index 4f5c101e6..916411986 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -279,7 +279,7 @@ * The `this` value is used if it's the global object to avoid Greasemonkey's * restricted `window` object, otherwise the `window` object is used. */ - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal; + var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); /*--------------------------------------------------------------------------*/ @@ -429,7 +429,7 @@ * @returns {null|Object} Returns `value` if it's a global object, else `null`. */ function checkGlobal(value) { - return (value && value.Object) ? value : null; + return (value && value.Object === Object) ? value : null; } /**