From 0b900d94f746f59af4c777a1dcf82a02d9810fb3 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 30 Oct 2014 22:01:00 -0700 Subject: [PATCH] Ensure `root` is set correctly when required by a greasemonkey userscript. [closes #759] --- lodash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index b70913573..f5cf936a2 100644 --- a/lodash.js +++ b/lodash.js @@ -277,7 +277,7 @@ }; /** Used as a reference to the global object */ - var root = (objectTypes[typeof window] && window) || this; + var root = (objectTypes[typeof window] && window !== (this && this.window)) ? window : this; /** Detect free variable `exports` */ var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;