Update root assignment to work in Firefox extensions. [closes #1340]

This commit is contained in:
Oliver Hoffmann
2015-07-13 19:49:05 +02:00
committed by John-David Dalton
parent ffd3e17364
commit df17244353

View File

@@ -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;
}
/**