mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 790732 - Fix automation detection to handle Components shim. rs=mccr8
This commit is contained in:
parent
21a28ed93e
commit
69ef591f26
@ -10,7 +10,12 @@ var archiveReaderEnabled = false;
|
||||
// and content mochitests (where the |Components| object is accessible only as
|
||||
// SpecialPowers.Components). Expose Components if necessary here to make things
|
||||
// work everywhere.
|
||||
if (typeof Components === 'undefined' && typeof SpecialPowers === 'object')
|
||||
//
|
||||
// Even if the real |Components| doesn't exist, we might shim in a simple JS
|
||||
// placebo for compat. An easy way to differentiate this from the real thing
|
||||
// is whether the property is read-only or not.
|
||||
var c = Object.getOwnPropertyDescriptor(this, 'Components');
|
||||
if ((!c.value || c.writable) && typeof SpecialPowers === 'object')
|
||||
Components = SpecialPowers.Components;
|
||||
|
||||
function executeSoon(aFun)
|
||||
|
@ -20,7 +20,11 @@
|
||||
// naming collisions with anything that might be defined in the scope that imports
|
||||
// this script.
|
||||
window.__defineGetter__('_EU_Ci', function() {
|
||||
return 'Components' in window ? Components.interfaces : SpecialPowers.Ci;
|
||||
// Even if the real |Components| doesn't exist, we might shim in a simple JS
|
||||
// placebo for compat. An easy way to differentiate this from the real thing
|
||||
// is whether the property is read-only or not.
|
||||
var c = Object.getOwnPropertyDescriptor(window, 'Components');
|
||||
return c.value && !c.writable ? Components.interfaces : SpecialPowers.Ci;
|
||||
});
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user